HTTPoison Post multipart/form-data with fields only

Hello I’m new to elixir and I’m doing a client request of HTTPoison, but I can’t seem to find a figure out multipart/form-data with only fields submitted

I don’t want to upload file or any, I just want to append the fields and make a POST request

an example of simple HTTPoision request "", "{\"body\": \"test\"}", [{"Content-Type", "application/json"}]

The underlying Erlang hackney library has some docs that suggest using :form instead of :multipart if there is no file to upload.

1 Like

You could try the following:"", {:multipart, [{"body", "test"}, {"body2", "test2"]}, ["Content-Type": "multipart/form-data"])

Hope it works for you or anyother person who may have same issue :slight_smile: