class Net::HTTPResponse
Monkey-patch Net::HTTPResponse
Add a final_url attribute, which we use in handling HTTP redirections to determine the ultimate URI that the response was retrieve from
Monkey-patch for Net::HTTPResponse
This file isn’t required by the gem by default, so require it in your code
Attributes
final_uri[RW]
Public Instance Methods
body()
click to toggle source
New version of body
unzips a gzipped body before returning it Call GoGetter.get
with the following in http_headers: “Accept-Encoding” => “gzip”)
# File lib/go_getter/response.rb, line 8 def body if key?("Content-Encoding") and fetch("Content-Encoding") == "gzip" body_io = StringIO.new(body_asis) Zlib::GzipReader.new(body_io).read else body_asis end end
Also aliased as: body_asis