title: HTTP multipart/form-data. What happends when binary data has no string representation?
body: <p><strong>I want to write an HTTP implementation.</strong></p>
  
  <p>I've been looking around for a few days about sending files over HTTP with <code>Content-Type: multipart/form-data</code>, and I'm really interested about how browsers (or any HTTP client) creates that kind of request.<br><br>
  <strong>I already took a look at a lots of questions about it here at stackoverflow like:<br></strong>
  <a href="https://stackoverflow.com/questions/8659808/how-does-http-file-upload-work">How does HTTP file upload work?</a><br>
  <a href="https://stackoverflow.com/questions/4526273/what-does-enctype-multipart-form-data-mean">What does enctype=&#39;multipart/form-data&#39; mean?</a><br><br>
  I dig into RFCs 2616 (and newer versions), 2046, etc. But I didn't find a clear answer (obviously I did not get the idea behind it).<br><br>At most articles and answers I found this piece of request string, that's is simple to me to interpret, all these things are documented at RFCs...</p>
  
  <pre><code>POST /upload?upload_progress_id=12344 HTTP/1.1
  Host: localhost:3000
  Content-Length: 1325
  Origin: http://localhost:3000
  ... other headers ...
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryePkpFF7tjBAqx29L
  
  ------WebKitFormBoundaryePkpFF7tjBAqx29L
  Content-Disposition: form-data; name="MAX_FILE_SIZE"
  
  100000
  ------WebKitFormBoundaryePkpFF7tjBAqx29L
  Content-Disposition: form-data; name="uploadedfile"; filename="hello.o"
  Content-Type: application/x-object
  
  ... contents of file goes here ...
  ------WebKitFormBoundaryePkpFF7tjBAqx29L--
  </code></pre>
  
  <p>...and it would be simple to implement an HTTP client to construct a piece of string that way in any language.<br><br>The problem becomes at <code>... contents of file goes here ...</code>, there's little information about what "contents of file" is. I know it's binary data with a certain type and encoding, but It's difficult to think out of <strong>string data</strong>, how I would add a piece of binary data that has no string representation inside a string.</p>
  
  <p>I would like to see examples of low level implementations of HTTP protocol with any language. And maybe in depth explanations about binary data transfer over HTTP, how client creates requests and how server read/parse it. <br><br><em>PD. I know this question my look a duplicate but most of the answers are not focused on explaining binary data transfer (like media).</em> </p>