Class: Faraday::Adapter

Inherits:
Middleware show all
Extended by:
Parallelism, AutoloadHelper
Defined in:
lib/faraday/adapter.rb,
lib/faraday/autoload.rb,
lib/faraday/adapter/rack.rb,
lib/faraday/adapter/test.rb,
lib/faraday/adapter/excon.rb,
lib/faraday/adapter/patron.rb,
lib/faraday/adapter/em_http.rb,
lib/faraday/adapter/net_http.rb,
lib/faraday/adapter/typhoeus.rb,
lib/faraday/adapter/httpclient.rb,
lib/faraday/adapter/em_synchrony.rb,
lib/faraday/adapter/net_http_persistent.rb,
lib/faraday/adapter/em_synchrony/parallel_manager.rb

Overview

Public: This is a base class for all Faraday adapters. Adapters are responsible for fulfilling a Faraday request.

Direct Known Subclasses

EMHttp, EMSynchrony, Excon, HTTPClient, NetHttp, Patron, Rack, Test, Typhoeus

Defined Under Namespace

Modules: Parallelism Classes: EMHttp, EMSynchrony, Excon, HTTPClient, NetHttp, NetHttpPersistent, Patron, Rack, Test, Typhoeus

Constant Summary collapse

CONTENT_LENGTH =
'Content-Length'.freeze

Instance Attribute Summary

Attributes included from Parallelism

#supports_parallel

Instance Method Summary collapse

Methods included from AutoloadHelper

all_loaded_constants, autoload_all, load_autoloaded_constants

Methods included from Parallelism

inherited, supports_parallel?

Methods inherited from Middleware

dependency, inherited, loaded?, new

Methods included from MiddlewareRegistry

#fetch_middleware, #load_middleware, #lookup_middleware, #middleware_mutex, #register_middleware

Constructor Details

#initialize(app = nil, opts = {}, &block) ⇒ Adapter


33
34
35
36
37
# File 'lib/faraday/adapter.rb', line 33

def initialize(app = nil, opts = {}, &block)
  super(app)
  @connection_options = opts
  @config_block = block
end

Instance Method Details

#call(env) ⇒ Object


39
40
41
# File 'lib/faraday/adapter.rb', line 39

def call(env)
  env.clear_body if env.needs_body?
end