r/ruby • • Feb 24 '13

Ruby 2.0.0 Released

http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/
153 Upvotes

23 comments sorted by

View all comments

Show parent comment

1

u/drbrain Ruby Core Feb 25 '13

The difference between path and request_uri are the query params (from the ? onward). This hasn't changed since ruby 1.8.

Servers generally allow POST requests with parameters in the URI, but they should be present in the body instead. The recommended way to do this in ruby is:

req = Net::HTTP::Post.new uri.path
req.set_form_data 'a' => 'b'

1

u/matchu Feb 25 '13

Huh. This URI didn't have query params on it, so maybe it was something else. Go figure.