Alex Rivera | Logout

How do I make a POST request with open-uri?

Asked 2008-10-28T08:58:48.833
32

Is it possible to make a POST request from Ruby with open-uri?

Edit
Report

2 Answers

35

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.

answered 2008-10-28T09:24:34.133
10

I'd also really recommend rest-client. It's a great base for writing an API client.

answered 2008-10-29T12:43:17.833

Your Answer