title: File upload API: Multipart/form-data vs. raw contents in body?
body: <p>I noticed there are (at least) two ways of uploading a file to a HTTP server via an API. </p>
  
  <p>You can use <code>multipart/form-data</code> (which is what browsers do natively for file upload HTML inputs), but you can also <code>POST</code> the file content inside the request body (perhaps with the correct Content-Type request header).</p>
  
  <p>What are the pros and cons of each method (in all generality, not from a browser)? </p>
  
  <p>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.</p>