I noticed that there are (at least) two ways to upload a file to an HTTP server through the API.
You can use multipart/form-data (this is what browsers do initially to load HTML input files), but you can also POST contents of the file inside the request body (possibly with the correct Content-Type request header).
What are the pros and cons of each method (in general, and not from the browser)?
Multi-page requests, for example, depending on which http or network library you use in your programming environment (I use Node.js on the server side and Swift on the client side) - it seems a little harder to create and then parse.
source share