Skip to content

Instantly share code, notes, and snippets.

@KrakenHH
Created June 9, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KrakenHH/acacaf6cd0ffaac70a4a9ffc6520bd32 to your computer and use it in GitHub Desktop.
Save KrakenHH/acacaf6cd0ffaac70a4a9ffc6520bd32 to your computer and use it in GitHub Desktop.
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end
@KrakenHH
Copy link
Author

KrakenHH commented Jun 9, 2016

Why is the third line not puts req.body

What is |http|

Why does it need to be http.request(req).body instead of req.body?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment