Support Multipart Forms
FallenValkyrie opened this issue · comments
Emma commented
Currently I cannot find any support for sending multipart Form data (multipart/form-data
), It would be great If that was possible.
Johan Bjäreholt commented
It's quite easy to do youself, just:
- generate a random boundary
- Set HTTP content type header with said boundary like this "multipart/form-data; boundary={}"
- For each part, loop this to create the HTTP body
- write start delimiter --BOUNDARY
- write "Content-Disposition" header and other optional HTTP headers for this specific part
- write \r\n\r\n to end header section
- write part body
- write \r\n
- Write ending boundary --BOUNDARY--
I have done this, but it is unfortunately not open source and has multiple very specific details that only fits my rare use-case so it's not really suitable for upstreaming.