does not handle Binary files
I made a fix to make it works with posting CSV files, but have no success with Jpeg file.
Ok, I'll look into it
2 PR that would fix this :) https://github.com/ofw/curlify/pull/22 https://github.com/ofw/curlify/pull/23
@leNEKO @ofw is it possible to merge this PRs?
I have the same issue.
Body:
n'x\x9c\x95Skk\xe2@\x...
Error:
File "/opt/ls/lx/release/d_dwe_lxstacon/local/ux_app/python/lib/python3.6/site-packages/curlify.py", line 28, in to_curl
body = body.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte
curlify always attempts to decode bytes into utf-8, which is almost always incorrect as different Content-Types are being used. In my case I solved it here by ensuring that the Content-Type is what I expect, then removing it from the request and decoding the bytes appropriately before passing the object to curlify.
I think that if curlify gets a request with non-textual Content-Type (or rather, if it gets body which is bytes) then it should prepare a command like echo -e .... | curl --data-binary @- as described here.