Java utility for creating RFC-compliant multipart and form-encoded HTTP request bodies.
Questions tagged [mimecraft]
2 questions
57
votes
7 answers
how to use okhttp to upload a file?
I use okhttp to be my httpclient. I think it's a good api but the doc is not so detailed.
how to use it to make a http post request with file uploading?
public Multipart createMultiPart(File file){
Part part = (Part) new…

user2219372
- 2,385
- 5
- 23
- 26
7
votes
3 answers
OkHttp buffers ~800kb before uploading data despite flush()
Im trying to publish upload progress for images, uploading them using okhttp as my client and mimecraft to package up the multipart file.
I have added logs to write the bytecount when data gets written to the socket (in chunks of 4kb if i can tell…

Glenn.nz
- 2,261
- 2
- 17
- 20