HTTPoison multipart post

I was able to get the post text fields to show up in pipe dream as text by adding [“Content-Type”: “text/plain”] to the payload tuple.

It still does not work on the vendor site. I reached out to the vendor and he suggested it may be the boundary that is causing the issue. I have the logs of the POST request from the vendor.

The working request via Insomnia REST Client

28/07 16.57.55.545       (2083 ms) 23.252.62.194        POST /api HTTP/1.1
content-type: [multipart/form-data; boundary=X-INSOMNIA-BOUNDARY]
accept: [*/*]
cookie: [sessionId=api_1.2.3.194_1659022119229_-1260159572]
authorization: [Bearer supersecretauthtoken]
host: [example.net]
content-length: [258197]
user-agent: [insomnia/2022.4.2]

file=/opt/stserver/tmp/foo.png&to=1234&from=15555555555&orgid=1234567890987564321

HTTP/1.1 200 OK
Date: [Thu, 28 Jul 2022 16:57:55]
Access-Control-Allow-Origin: [*]
Access-Control-Allow-Credentials: [true]
Server: [Smile CTI Server]
Set-Cookie: [sessionId=api_1.2.3.194_1659027473462_-1149585348]
Connection: [close]
Content-Type: [application/json; charset=UTF-8]
Content-Length: [59]

The non working HTTPoison request

28/07 17.03.09.660       (578 ms)1.2.3.194 POST /api HTTP/1.1
content-type: [multipart/form-data; boundary=---------------------------nhzzivvxhvzlhrmf]
accept: [*/*]
authorization: [Bearer supersecretauthtoken]
host: [example.net]
content-length: [258478]
user-agent: [hackney/1.18.1]


HTTP/1.1 400 Bad Request
Date: [Thu, 28 Jul 2022 17:03:09]
Access-Control-Allow-Origin: [*]
Access-Control-Allow-Credentials: [true]
Server: [Smile CTI Server]
Connection: [close]
Content-Length: [0]