Search code examples
rubyopen-uri

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


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


Solution

  • 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.