class Net::HTTPResponse
Public Instance Methods
plain_body()
click to toggle source
Return the uncompressed content
# File lib/xero_gateway/http_encoding_helper.rb, line 30 def plain_body encoding=self['content-encoding'] content=nil if encoding then case encoding when 'gzip' i=Zlib::GzipReader.new(StringIO.new(self.body)) content=i.read when 'deflate' i=Zlib::Inflate.new content=i.inflate(self.body) else raise "Unknown encoding - #{encoding}" end else content=self.body end return content end