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
fields
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
HTTPoison.post "http://httparrot.herokuapp.com/post", "{\"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.
:form
:multipart
You could try the following:
HTTPoison.post("http://httparrot.herokuapp.com/post", {:multipart, [{"body", "test"}, {"body2", "test2"]}, ["Content-Type": "multipart/form-data"])
Hope it works for you or anyother person who may have same issue