class HTTParty::Request

def handle_response(response)

Raises exception Net::XXX (http error code) if an http error occured
def handle_response(response)
  case response
    when Net::HTTPRedirection
      options[:limit] -= 1
      self.path = response['location']
      @redirect = true
      perform
    else
      parsed_response = parse_response(response.body)
      Response.new(parsed_response, response.body, response.code, response.to_hash)
    end
end