class Faraday::Request
def self.create(request_method)
def self.create(request_method) new(request_method).tap do |request| yield(request) if block_given? end end
def [](key)
def [](key) headers[key] end
def []=(key, value)
def []=(key, value) headers[key] = value end
def headers=(hash)
def headers=(hash) if headers headers.replace hash else super end end
def params=(hash)
def params=(hash) if params params.replace hash else super end end
def to_env(connection)
:password - Proxy server password
:user - Proxy server username
:uri - Proxy Server URI
:proxy - Hash of proxy options
:open_timeout - read timeout Integer in seconds
:timeout - open/read timeout Integer in seconds
:request - Hash of options for configuring the request.
:parallel_manager - sent if the connection is in parallel mode
:response_headers - Hash of HTTP headers from the server
:request_headers - hash of HTTP Headers to be sent to the server
:status - HTTP response status code
:url - URI instance for the current request.
:body - the request body that will eventually be converted to a string.
:method - a symbolized request method (:get, :post)
ENV Keys
def to_env(connection) Env.new(method, body, connection.build_exclusive_url(path, params), options, headers, connection.ssl, connection.parallel_manager) end
def url(path, params = nil)
def url(path, params = nil) if path.respond_to? :query if query = path.query path = path.dup path.query = nil end else anchor_index = path.index('#') path = path.slice(0, anchor_index) unless anchor_index.nil? path, query = path.split('?', 2) end self.path = path self.params.merge_query query, options.params_encoder self.params.update(params) if params end