We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Require the gem in your project:
require 'http'
And make a GET request:
>> response = HTTP.get('https://www.google.com') => #<HTTP/1.0 200 OK @headers={"Content-Type"=>"text/html; charset=UTF-8", "Date"=>"Fri, ...>
We now have a HTTP::Response object for the given request. We can obtain the body by calling #to_s on it:
HTTP::Response
#to_s
>> response.to_s => "<html><head><meta http-equiv=\"content-type\" content=..."
Or get the response status code by calling #code:
#code
>> response.code => 200
There was an error while loading. Please reload this page.