Search code examples
restrest-clientonenote-apiinsomnia

Insomnia REST Client - Set "Content-Type" for multipart/form-data


TL;DR How can I set the Content-Type headers for each individual file/input/text in a multipart/form-data request (in Insomnia)?

I'm trying to POST to the OneNote API (HTTP description) using the Insomnia Rest Client. Per the documentation, I need to submit a multipart/form-data request with one file/text with headers:

Content-Type: text/html Content-Disposition: form-data; name=presentation

and another with the headers:

Content-Type: application/inkml+xml Content-Disposition: form-data; name=presentation-onenote-inkml

Here is a screenshot of what I am trying: headers As you can see, the API returns an error with No Content-Type leading me to believe that the Content-Type header is not set. The debug information is below: debug The POST data is hidden, which does not allow me to see the Content-Type.


Solution

  • Solution: When you use POST with the file arguments, this works. I don't know why.

    solution image