def handle_deflation
      case last_response["content-encoding"]
      when "gzip"
        body_io = StringIO.new(last_response.body)
        last_response.body.replace Zlib::GzipReader.new(body_io).read
      when "deflate"
        last_response.body.replace Zlib::Inflate.inflate(last_response.body)
      end
    end
def handle_deflation
      case last_response["content-encoding"]
      when "gzip"
        body_io = StringIO.new(last_response.body)
        last_response.body.replace Zlib::GzipReader.new(body_io).read
      when "deflate"
        last_response.body.replace Zlib::Inflate.inflate(last_response.body)
      end
    end
Inspired by Ruby 1.9