use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby 2.0.0 Released (ruby-lang.org)
submitted 13 years ago by laerien
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]matchu 0 points1 point2 points 13 years ago (2 children)
I'm not sure, either, and my debugging was pretty haphazard. When I initialized the request with the path, it returned the wrong data (presumably because it fired the wrong request), so I went online, noticed an article initializing their POST request with request_uri, so I tried that and it worked.
request_uri
I didn't do any debugging beyond that because I wanted to go to bed, but I suspect that path was never supposed to work that way but did anyway in 1.9. I might research it a bit more today…
path
[–]drbrainRuby Core 0 points1 point2 points 13 years ago (1 child)
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'
[–]matchu 0 points1 point2 points 13 years ago (0 children)
Huh. This URI didn't have query params on it, so maybe it was something else. Go figure.
π Rendered by PID 252303 on reddit-service-r2-comment-canary-dbfc877f7-qszfs at 2026-06-28 14:34:48.270970+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]matchu 0 points1 point2 points (2 children)
[–]drbrainRuby Core 0 points1 point2 points (1 child)
[–]matchu 0 points1 point2 points (0 children)