lib/httparty/request.rb
# Raises exception Net::XXX (http error code) if an http error occured
Raises exception Net::XXX  if an http error occured
Raises exception Net :: XXX if an http error occured
def handle_response(response)
        case response
        when Net::HTTPMultipleChoice,              
          Net::HTTPMovedPermanently,               
          Net::HTTPFound,                          
          Net::HTTPSeeOther,                       
          Net::HTTPUseProxy,                       
          Net::HTTPTemporaryRedirect
            options[:limit] -= 1
            self.path = response['location']
            @redirect = true
            self.http_method = Net::HTTP::Get
            capture_cookies(response)
            perform
          else
            Response.new(parse_response(response.body), response.body, response.code, response.message, response.to_hash)
          end
      end
def handle_response ( response ) case response when Net :: HTTPMultipleChoice , Net :: HTTPMovedPermanently , Net :: HTTPFound , Net :: HTTPSeeOther , Net :: HTTPUseProxy , Net :: HTTPTemporaryRedirect options [ :limit ] -= 1 self . path = response [ 'location' ] @redirect = true self . http_method = Net :: HTTP :: Get capture_cookies ( response ) perform else Response . new ( parse_response ( response . body ) , response . body , response . code , response . message , response . to_hash ) end end
Raises exception Net::XXX (http error code) if an http error occured
Raises exception Net :: XXX ( http error code ) if an http error occured
# 300 # 301 # 302 # 303 # 305
response
<not_specific>