Recreate a multipart/form-data request
Last updated
Last updated
First, create a file with the content of the request:
Create the file to upload:
Then, take the port from before and listen in that port:
Now, open the .html
file in the browser, select the file and submit the request, we will see something like:
Let's keep in mind this:
https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
A boundary is used to differentiate the information traveling across the request, to "divide" and to indicate where is the start and the end of it.
In our example:
In the header, we define the boundary, and it has three dashes (---) next to random info.
In the body request, the boundary is the same, but, we need to append in the start two dashes (required). SO, if our boundary is boundary=ay, our body boundary will be: --ay.
In the last line of our information, the request needs that our boundary contains two dashes (--) in the final. This is to indicate the final boundary info for that part.