Re:Command Line Faxing
by zrail on Monday August 04, 2014 @12:10PM
(#8132442)
Because I'm lazy, basically. I already had a working curl command, I just wanted to make it sanity check my arguments. Also, in my experience convincing the various Ruby libraries to do multipart form uploads (for the documents themselves) is sort of a pain (but if there's an alternative I would love to hear it!)
[ Parent
| on HN ]
Sorry, can't make any Ruby suggestions. I spend more time in the Python world where we have requests[0], which makes it all dead simple.
For example, multipart file uploads looks like:
files = {'filename[]': open(filename, 'rb')}
data = {'to': to, 'api_key': api_key, 'api_secret': api_secret}
response = requests.post(url, data=data, files=files)
[0]http://docs.python-requests.org/en/latest/