Trying to change Content-Type in a POST request using HTTPoison

Hello all, I’m trying to make a POST request using HTTPoison, where I need to set the Content-Type header.

According to this test, this should let us set the Content-Type to multipart/form-data: "", {:form, [doc: "HTML"]}, [{"Content-Type", "multipart/form-data"}]

…but it doesn’t. At least, the server complains with “application/x-www-form-urlencoded not supported. Please use multipart/form-data.”.

I’ve also tried posting it to, which reflects back what you send it, and I don’t see this header being set.

What am I doing wrong?


Solved in Slack by @sschneider – this is the correct way to send a multipart form:"", {:multipart, [{"out", "json"}, {"content", "HTML"}]})