HTML - multipart/form-data encoding / mime

About

multipart/form-data is a mime part used in the enctype form attribute to encode the keyword and corresponding state of input field before sending into the body of the HTTP request

A formdata when send via XHR is encoded in this format

Example

------kYFrd4jNJEgCervE
Content-Disposition: form-data; name="t"

cats
------kYFrd4jNJEgCervE
Content-Disposition: form-data; name="q"

fur
------kYFrd4jNJEgCervE--

This encoding could have been created with this form where cats and fur are the data entered in the input field t and q

<form action="/find.cgi" method=post enctype="multipart/form-data">
 <input type=text name=t>
 <input type=search name=q>
 <input type=submit>
</form>

Documentation / Reference


Powered by ComboStrap