agoda-com / agoda-com/ninjato

Example of uploading raw binary data file using Ninjato

Ouverte
#16 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Kotlin
Étoiles
114
Forks
9
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

# Question

I've been working with Ninjato for non-upload calls for a couple weeks now, and it works great! Very flexible and does everything I've needed with intercepting responses and retry logic and everything.

However, I can't seem to figure out how to construct a MultiPartEntity / MultiPart Body like I've used before in Apache's old HTTP libraries and add it to the Ninjato Body object. I see the okhttp MultiPartBody but I'm not sure a) how to use this with Ninjato's Body object, and b) not sure how to `addBinaryPart()` like I did in Apache (see below method I am looking for in Ninjato)

```
public MultipartEntityBuilder addBinaryBody(String name, byte[] b, ContentType contentType, String filename) {
return this.addPart(name, new ByteArrayBody(b, contentType, filename));
}
```

# Suggestion (Optional)

If this doesn't already exist in the sample app / sample code or docs, can it be added? I must be missing something.

# Environment

I am using version `0.3.1` which is indicated to be the latest version both in the `README.md` and at maven central. I am working in Kotlin wherever possible but I am interfacing with a fair amount of existing Java as well.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.