class HTTP::Client
def perform(req, options)
def perform(req, options) verify_connection!(req.uri) @state = :dirty begin @connection ||= HTTP::Connection.new(req, options) unless @connection.failed_proxy_connect? @connection.send_request(req) @connection.read_headers! end rescue Error => e options.features.each_value do |feature| feature.on_error(req, e) end raise end res = build_response(req, options) res = options.features.inject(res) do |response, (_name, feature)| feature.wrap_response(response) end @connection.finish_response if req.verb == :head @state = :clean res rescue close raise end