Module: Faraday
- Defined in:
- lib/faraday.rb,
lib/faraday/error.rb,
lib/faraday/utils.rb,
lib/faraday/adapter.rb,
lib/faraday/methods.rb,
lib/faraday/options.rb,
lib/faraday/request.rb,
lib/faraday/version.rb,
lib/faraday/response.rb,
lib/faraday/connection.rb,
lib/faraday/middleware.rb,
lib/faraday/options/env.rb,
lib/faraday/adapter/test.rb,
lib/faraday/rack_builder.rb,
lib/faraday/request/json.rb,
lib/faraday/response/json.rb,
lib/faraday/utils/headers.rb,
lib/faraday/response/logger.rb,
lib/faraday/adapter_registry.rb,
lib/faraday/logging/formatter.rb,
lib/faraday/utils/params_hash.rb,
lib/faraday/middleware_registry.rb,
lib/faraday/options/ssl_options.rb,
lib/faraday/request/url_encoded.rb,
lib/faraday/response/raise_error.rb,
lib/faraday/options/proxy_options.rb,
lib/faraday/request/authorization.rb,
lib/faraday/options/request_options.rb,
lib/faraday/request/instrumentation.rb,
lib/faraday/options/connection_options.rb,
lib/faraday/encoders/flat_params_encoder.rb,
lib/faraday/encoders/nested_params_encoder.rb
Overview
Faraday namespace.
Defined Under Namespace
Modules: DecodeMethods, EncodeMethods, FlatParamsEncoder, Logging, MiddlewareRegistry, NestedParamsEncoder, Utils Classes: Adapter, AdapterRegistry, BadRequestError, ClientError, ConflictError, Connection, ConnectionFailed, ConnectionOptions, Env, Error, ForbiddenError, InitializationError, Middleware, NilStatusError, Options, ParsingError, ProxyAuthError, ProxyOptions, RackBuilder, Request, RequestOptions, RequestTimeoutError, ResourceNotFound, Response, SSLError, SSLOptions, ServerError, TimeoutError, TooManyRequestsError, UnauthorizedError, UnprocessableEntityError
Constant Summary collapse
- CONTENT_TYPE =
'Content-Type'
- METHODS_WITH_QUERY =
%w[get head delete trace].freeze
- METHODS_WITH_BODY =
%w[post put patch].freeze
- VERSION =
'2.12.0'
Class Attribute Summary collapse
- .default_adapter ⇒ Object
-
.default_adapter_options ⇒ Object
Option for the default_adapter @return [Hash] default_adapter options.
- .default_connection ⇒ Object
-
.ignore_env_proxy ⇒ Boolean
Tells Faraday to ignore the environment proxy (http_proxy).
-
.lib_path ⇒ String
Gets or sets the path that the Faraday libs are loaded from.
-
.root_path ⇒ String
The root path that Faraday is being loaded from.
Class Method Summary collapse
-
.default_connection_options ⇒ Faraday::ConnectionOptions
Gets the default connection options used when calling Faraday.new.
-
.default_connection_options=(options) ⇒ Object
Sets the default options used when calling Faraday.new.
-
.new(url = nil, options = {}, &block) ⇒ Faraday::Connection
Initializes a new Connection.
- .respond_to_missing?(symbol, include_private = false) ⇒ Boolean
Class Attribute Details
.default_adapter ⇒ Symbol .default_adapter=(adapter) ⇒ Symbol
55 56 57 |
# File 'lib/faraday.rb', line 55 def default_adapter @default_adapter end |
.default_adapter_options ⇒ Object
Option for the default_adapter
@return [Hash] default_adapter options
59 60 61 |
# File 'lib/faraday.rb', line 59 def @default_adapter_options end |
.default_connection ⇒ Faraday::Connection .default_connection=(connection) ⇒ Object
120 121 122 |
# File 'lib/faraday.rb', line 120 def default_connection @default_connection ||= Connection.new() end |
.ignore_env_proxy ⇒ Boolean
Tells Faraday to ignore the environment proxy (http_proxy). Defaults to ‘false`.
67 68 69 |
# File 'lib/faraday.rb', line 67 def ignore_env_proxy @ignore_env_proxy end |
.lib_path ⇒ String
Gets or sets the path that the Faraday libs are loaded from.
46 47 48 |
# File 'lib/faraday.rb', line 46 def lib_path @lib_path end |
.root_path ⇒ String
The root path that Faraday is being loaded from.
This is the root from where the libraries are auto-loaded.
42 43 44 |
# File 'lib/faraday.rb', line 42 def root_path @root_path end |
Class Method Details
.default_connection_options ⇒ Faraday::ConnectionOptions
Gets the default connection options used when calling new.
127 128 129 |
# File 'lib/faraday.rb', line 127 def @default_connection_options ||= ConnectionOptions.new end |
.default_connection_options=(options) ⇒ Object
Sets the default options used when calling new.
134 135 136 137 |
# File 'lib/faraday.rb', line 134 def () @default_connection = nil @default_connection_options = ConnectionOptions.from() end |
.new(url = nil, options = {}, &block) ⇒ Faraday::Connection
Initializes a new Connection.
96 97 98 99 |
# File 'lib/faraday.rb', line 96 def new(url = nil, = {}, &block) = Utils.deep_merge(, ) Faraday::Connection.new(url, , &block) end |
.respond_to_missing?(symbol, include_private = false) ⇒ Boolean
107 108 109 |
# File 'lib/faraday.rb', line 107 def respond_to_missing?(symbol, include_private = false) default_connection.respond_to?(symbol, include_private) || super end |