Is it possible to make a POST request from Ruby with open-uri?
+4
A:
Unfortunately open-uri
only supports the GET
verb.
You can either drop down a level and use net/http
, or use rest-open-uri
, which was designed to support POST
and other verbs. You can do gem install rest-open-uri
to install it.
Martin Kenny
2008-10-28 09:24:34
+1
A:
I'd also really recommend rest-client. It's a great base for writing an API client.
tomtaylor
2008-10-29 12:43:17