I noticed there are (at least) two ways of uploading a file to a HTTP server via an API.
You can use multipart/form-data
(which is what browsers do natively for file upload HTML inputs), but you can also POST
the file content inside the request body (perhaps with the correct Content-Type request header).
What are the pros and cons of each method (in all generality, not from a browser)?
Multipart requests for instance – depending on which http or networking library you use in your programming environment (I use Node.js on the server side and Swift on the client side) – seem to be a bit more complex to create and then parse.