Unfortunately open-uri only supports the GET verb.
open-uri
GET
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.
net/http
rest-open-uri
POST
gem install rest-open-uri
require 'open-uri'require 'net/http'params = {'param1' => 'value1', 'param2' => 'value2'}url = URI.parse('http://thewebsite.com/thepath')resp, data = Net::HTTP.post_form(url, params)puts resp.inspectputs data.inspect
It worked for me :)
I'd also really recommend rest-client. It's a great base for writing an API client.