Looking into multipart/related and when trying to research the specifications I find examples such as:
Content-Type: multipart/mixed; boundary="__the_boundary__"
--__the_boundary__
This is the first part, in plain text.
--__the_boundary__
Content-Type: text/plain; charset=us-ascii
This is the second part, also in plain text but with a Content-Type header.
--__the_boundary__--
POST /submit.cgi HTTP/1.1
Host: example.com
Content-Length: 313
Content-Type: multipart/form-data; boundary=d74496d66958873e
--d74496d66958873e
Content-Disposition: form-data; name="person"
anonymous
--d74496d66958873e
Content-Disposition: form-data; name="secret"; filename="file.txt"
Content-Type: text/plain
contents of the file
--d74496d66958873e--
I assume Content-Type
and other HTTP Headers above the first boundary is not supposed to be in the actual POST body, but be specified as an HTTP Header?