Specification for multipart/form-data

443 views
Skip to first unread message

Bob van der Linden

unread,
May 25, 2020, 8:10:24 AM5/25/20
to HTTP Archive Specification
Hi all!

Currently the specification isn't mentioning multipart/form-data explicitly. This leads to some confusion as to how these requests should be encoded in HAR.
does mention `multipart/form-data` in an example:

"postData": {
    "mimeType": "multipart/form-data",
    "params": [],
    "text" : "plain posted data",
    "comment": ""
}

Although this raises more questions than answers. Should the boundary be added in the mimetype? Is the `plain posted data` one of the 'parts' of the form-data or just dummy data for the example?

In addition, when Chrome exports HAR for multipart/form-data, it doesn't export the `postData` field at all. So when forms are posted using `application/x-www-form-urlencoded` it does show parameters, but when the form is submitted using multipart/form-data it isn't emitted at all. This too causes quite a bit of confusion. Is it fine for Chrome to leave out the postData like that or does the specification require postData to be there when the request has a request body?

If the specification should become stricter on this topic, where is the best place to do such proposals?

I ran into these issues while working on a CLI tool to generate and manipulate HAR files: https://github.com/bobvanderlinden/harhar

Regards,
Bob van der Linden
Reply all
Reply to author
Forward
0 new messages