This is a HTTP POST request sent with the request body specially formatted as a series of “parts”, separated by a boundary string. It allows a mix for form data, files etc to be sent as a HTTP POST.

Resources

https://ec.haxx.se/http-multipart.html

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST

Example 1

Form
<form action="my_post_page.php" method="post" enctype="multipart/form-data">

</form> 
html that is sent
POST /submit.cgi HTTP/1.1
Host: example.com
User-Agent: curl/7.46.0
Accept: */*
Content-Length: 313
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------MyFormBoundaryvZ0ZHShNAcBABWFy
------MyFormBoundaryvZ0ZHShNAcBABWFy
Content-Disposition: form-data; name="fileToUpload"; filename="data.txt"
Content-Type: text/plain

Hello
------MyFormBoundaryvZ0ZHShNAcBABWFy
Content-Disposition: form-data; name="secret"; filename="file.txt"
Content-Type: text/plain

The contents of this file
------MyFormBoundaryvZ0ZHShNAcBABWFy--

The last boundary has “–” added to the end of it

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published.