Parametrized get request in Ruby?

Posted by Horace Loeb on Stack Overflow See other posts from Stack Overflow or by Horace Loeb
Published on 2009-08-09T20:33:49Z Indexed on 2010/05/13 19:44 UTC
Read the original article Hit count: 421

Filed under:
|
|
|

How do I make an HTTP GET request with parameters in Ruby?

It's easy to do when you're POSTing:

  require 'net/http'
  require 'uri'

  HTTP.post_form URI.parse('http://www.example.com/search.cgi'),
                 { "q" => "ruby", "max" => "50" }

But I see now way of passing GET parameters as a hash using net/http.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about ruby-on-rails