class Faraday::Connection

def run_request(method, url, body, headers)

Returns:
  • (Faraday::Response) -

Parameters:
  • headers (Hash, nil) -- unencoded HTTP header key/value pairs.
  • body (String, Hash, Array, nil) -- The request body that will eventually be converted to
  • url (String, URI, nil) -- String or URI to access.
  • method (Symbol) -- HTTP method.
def run_request(method, url, body, headers)
  unless METHODS.include?(method)
    raise ArgumentError, "unknown http method: #{method}"
  end
  request = build_request(method) do |req|
    req.options.proxy = proxy_for_request(url)
    req.url(url)                if url
    req.headers.update(headers) if headers
    req.body = body             if body
    yield(req) if block_given?
  end
  builder.build_response(self, request)
end