def process_http_request(res)
      case res
      when HTTP_SUCCESS
        Log.debug('Http success')
        res
      when HTTP_CLIENT_ERROR
        fail Error.from_http_response(res)
      else
        Log.debug('Http error')
        Log.debug(res.body)
        res.error!
      end
    end
def process_http_request(res)
      case res
      when HTTP_SUCCESS
        Log.debug('Http success')
        res
      when HTTP_CLIENT_ERROR
        fail Error.from_http_response(res)
      else
        Log.debug('Http error')
        Log.debug(res.body)
        res.error!
      end
    end
need to have original request to process the response when it redirects