News for hackers. Stuff that matters.
Re:Command Line Faxing by tghw on Monday August 04, 2014 @12:06PM (#8132416)
Does Ruby not have a good HTTP library? Why would you ever shell out to curl?
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!)
Re:Command Line Faxing by tghw on Monday August 04, 2014 @12:37PM (#8132609)
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/