Hey,
I need to call a very tricky API.
My non-functioning curl request looked like this:
curl -X POST \
https://domain.tld \
-H 'some-header: some-value' \
-d 'Some\nValue'
After very long debugging, I found a working version:
curl -X POST \
https://domain.tld \
-H 'some-header: some-value' \
--data-binary $'Some\r\nValue'
--compressed
As you can see, the -d ''
was replaced by --data-binary $''
where the normal \n
was replaced by \r\n
. The --compressed
flag also has to be there.
An example of my current setup is:
content = """
Some
Value
"""
HTTPoison.post!(url, content, headers, options)
Now I have no clue how to translate the changes to the curl command to HTTPoison.
Any help is greatly appreciated