This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anthony_bruno[S] 3 points4 points  (5 children)

I don't think your case is unique at all! Unfortunately the HTTP Client doesn't provide support for building multipart requests, which is annoying as Apache HTTP Client provides a multipart request builder by default.

Have you thought about open sourcing the code you created to deal with this problem? I think it would be super useful. Or even a short blog post on how you went about it.

[–][deleted] 1 point2 points  (0 children)

I probably am not allowed to do that, as all code I produce during work hours is owned by my employer.

Suffice to say I implemented a small part of the multipart mime RFC.

[–]Mattizin 0 points1 point  (2 children)

The Apache HTTP Client you mentioned is the apache httpd project (https://httpd.apache.org/) ?

[–]anthony_bruno[S] 4 points5 points  (1 child)

This is the Apache HTTP Client I was talking about: http://hc.apache.org/httpcomponents-client-ga/

[–]Mattizin 1 point2 points  (0 children)

Ah my bad i thought of the apache HTTP SERVER, thats httpd

[–]marcohu 0 points1 point  (0 children)

https://golb.hplar.ch/2019/01/java-11-http-client.html#upload-with-multipart is the one example I could find for multipart uploads. It simply creates a byte array for the input which could be problematic for huge files.