I'm not clear what they are and the less I can see when to use them.
In example I have REST client and I want to send one file(.zip file), what exactly happens if I use any of those type
But if I want to send only one file what exectly multipart gives me that octet-stream doesn't have?
In both requests the whole file is somehow encoded inside, right? How does the processing differ. I don't see any advantage. Why Feign client tutorials use multipart or is it just common practice?
Further more I have found that somehow you need to also enable the whole multipart circus in the server to be able to receive it. So what is the point?
In the past, I used application/zip
or application/octet-stream
for .zip
file. For your case, either one of these headers should work fine.
Per another commenter -
"Multipart is for sending multiple parts (e.g. form fields and some files) in one single HTTP request, with file name and encoding specified. It does not split huge files into parts. One file is still just one part in a multipart request. HTTP headers can be included in both cases. "
The following threads may also provide more context: