vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/connection.rb
# Builds and runs the Faraday::Request.
#
# @param method [Symbol] HTTP method.
# @param url [String, URI] String or URI to access.
# @param body [Object] The request body that will eventually be converted to
#             a string.
# @param headers [Hash] unencoded HTTP header key/value pairs.
#
# @return [Faraday::Response]
Builds and runs the Faraday::Request.
Builds and runs the Faraday :: Request .
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
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
Builds and runs the Faraday::Request.
Builds and runs the Faraday :: Request .
None
Faraday::Response
method
None
url
String or URI to access.
String or URI to access .
body
The request body that will eventually be converted to a string.
The request body that will eventually be converted to a string .
headers
unencoded HTTP header key/value pairs.
unencoded HTTP header key / value pairs .