Module: Faraday

### Home Classes Methods

### In Files

- lib/faraday.rb
- lib/faraday/adapter.rb
- lib/faraday/adapter/em_http.rb
- lib/faraday/adapter/em_synchrony.rb
- lib/faraday/adapter/em_synchrony/parallel_manager.rb
- lib/faraday/adapter/excon.rb
- lib/faraday/adapter/httpclient.rb
- lib/faraday/adapter/net_http.rb
- lib/faraday/adapter/net_http_persistent.rb
- lib/faraday/adapter/patron.rb
- lib/faraday/adapter/rack.rb
- lib/faraday/adapter/test.rb
- lib/faraday/adapter/typhoeus.rb
- lib/faraday/autoload.rb
- lib/faraday/connection.rb
- lib/faraday/error.rb
- lib/faraday/middleware.rb
- lib/faraday/options.rb
- lib/faraday/parameters.rb
- lib/faraday/rack_builder.rb
- lib/faraday/request.rb
- lib/faraday/request/authorization.rb
- lib/faraday/request/basic_authentication.rb
- lib/faraday/request/instrumentation.rb
- lib/faraday/request/multipart.rb
- lib/faraday/request/retry.rb
- lib/faraday/request/token_authentication.rb
- lib/faraday/request/url_encoded.rb
- lib/faraday/response.rb
- lib/faraday/response/logger.rb
- lib/faraday/response/raise_error.rb
- lib/faraday/upload_io.rb
- lib/faraday/utils.rb

### Namespace

- MODULE Faraday::AutoloadHelper
- MODULE Faraday::FlatParamsEncoder
- MODULE Faraday::MiddlewareRegistry
- MODULE Faraday::NestedParamsEncoder
- MODULE Faraday::Utils
- CLASS Faraday::Adapter
- CLASS Faraday::ClientError
- CLASS Faraday::CompositeReadIO
- CLASS Faraday::Connection
- CLASS Faraday::ConnectionFailed
- CLASS Faraday::ConnectionOptions
- CLASS Faraday::Env
- CLASS Faraday::Error
- CLASS Faraday::Middleware
- CLASS Faraday::MissingDependency
- CLASS Faraday::Options
- CLASS Faraday::ParsingError
- CLASS Faraday::ProxyOptions
- CLASS Faraday::RackBuilder
- CLASS Faraday::Request
- CLASS Faraday::RequestOptions
- CLASS Faraday::ResourceNotFound
- CLASS Faraday::Response
- CLASS Faraday::SSLError
- CLASS Faraday::SSLOptions
- CLASS Faraday::TimeoutError

### Methods

- ::const_missing
- ::default_adapter=
- ::default_connection
- ::default_connection_options
- ::new
- ::require_lib
- ::require_libs

### Class/Module Index

Quicksearch

- Faraday
- Faraday::Adapter
- Faraday::Adapter::EMHttp
- Faraday::Adapter::EMHttp::Manager
- Faraday::Adapter::EMHttp::Options
- Faraday::Adapter::EMSynchrony
- Faraday::Adapter::EMSynchrony::ParallelManager
- Faraday::Adapter::Excon
- Faraday::Adapter::HTTPClient
- Faraday::Adapter::NetHttp
- Faraday::Adapter::NetHttpPersistent
- Faraday::Adapter::Parallelism
- Faraday::Adapter::Patron
- Faraday::Adapter::Rack
- Faraday::Adapter::Test
- Faraday::Adapter::Test::Stub
- Faraday::Adapter::Test::Stubs
- Faraday::Adapter::Test::Stubs::NotFound
- Faraday::Adapter::Typhoeus
- Faraday::AutoloadHelper
- Faraday::ClientError
- Faraday::CompositeReadIO
- Faraday::Connection
- Faraday::ConnectionFailed
- Faraday::ConnectionOptions
- Faraday::Env
- Faraday::Error
- Faraday::FlatParamsEncoder
- Faraday::Middleware
- Faraday::MiddlewareRegistry
- Faraday::MissingDependency
- Faraday::NestedParamsEncoder
- Faraday::Options
- Faraday::ParsingError
- Faraday::ProxyOptions
- Faraday::RackBuilder
- Faraday::RackBuilder::Handler
- Faraday::RackBuilder::StackLocked
- Faraday::Request
- Faraday::Request::Authorization
- Faraday::Request::BasicAuthentication
- Faraday::Request::Instrumentation
- Faraday::Request::Instrumentation::Options
- Faraday::Request::Multipart
- Faraday::Request::Retry
- Faraday::Request::Retry::Options
- Faraday::Request::TokenAuthentication
- Faraday::Request::UrlEncoded
- Faraday::RequestOptions
- Faraday::ResourceNotFound
- Faraday::Response
- Faraday::Response::Logger
- Faraday::Response::Middleware
- Faraday::Response::RaiseError
- Faraday::SSLError
- Faraday::SSLOptions
- Faraday::TimeoutError
- Faraday::Utils
- Faraday::Utils::Headers
- Faraday::Utils::ParamsHash
- EmHttpSslPatch
- Object

No matching classes.

# Faraday

Public: This is the main namespace for Faraday. You can either use it to create Faraday::Connection objects, or access it directly.

Examples

    Faraday.get "http://faraday.com"

    conn = Faraday.new "http://faraday.com"
    conn.get '/'

Rely on autoloading instead of explicit require; helps avoid the "already initialized constant" warning on Ruby 1.8.7 when NetHttp is refereced below. require 'faraday/adapter/net_http'

### Constants

Parts
Timer
UploadIO
VERSION

### Attributes

default_adapter[R]

Public: Gets or sets the Symbol key identifying a default Adapter to use for the default Faraday::Connection.

default_connection[W]

Public: Sets the default Faraday::Connection for simple scripts that access the Faraday constant directly.

    Faraday.get "https://faraday.com"

default_connection_options[W]

Public: Sets the default options used when calling Faraday#new.

lib_path[RW]

Public: Gets or sets the path that the Faraday libs are loaded from.

root_path[RW]

Public: Gets or sets the root path that Faraday is being loaded from. This is the root from where the libraries are auto-loaded from.

### Public Class Methods

const_missing(name) click to toggle source

    # File lib/faraday.rb, line 231
    def self.const_missing(name)
      if name.to_sym == :Builder
        warn "Faraday::Builder is now Faraday::RackBuilder."
        const_set name, RackBuilder
      else
        super
      end
    end

default_adapter=(adapter) click to toggle source

Public: Updates default adapter while resetting default_connection.

Returns the new default_adapter.

    # File lib/faraday.rb, line 88
    def default_adapter=(adapter)
      @default_connection = nil
      @default_adapter = adapter
    end

default_connection() click to toggle source

Gets the default connection used for simple scripts.

Returns a Faraday::Connection, configured with the default_adapter.

    # File lib/faraday.rb, line 110
    def self.default_connection
      @default_connection ||= Connection.new
    end

default_connection_options() click to toggle source

Gets the default connection options used when calling Faraday#new.

Returns a Faraday::ConnectionOptions.

    # File lib/faraday.rb, line 117
    def self.default_connection_options
      @default_connection_options ||= ConnectionOptions.new
    end

new(url = nil, options = nil) click to toggle source

Public: Initializes a new Faraday::Connection.

url - The optional String base URL to use as a prefix for all

    requests.  Can also be the options Hash.

options - The optional Hash used to configure this Faraday::Connection.

    Any of these values will be set on every request made, unless
    overridden for a specific request.
    :url     - String base URL.
    :params  - Hash of URI query unencoded key/value pairs.
    :headers - Hash of unencoded HTTP header key/value pairs.
    :request - Hash of request options.
    :ssl     - Hash of SSL options.
    :proxy   - Hash of Proxy options.

Examples

    Faraday.new 'http://faraday.com'

    # http://faraday.com?page=1
    Faraday.new 'http://faraday.com', :params => {:page => 1}

    # same

    Faraday.new :url => 'http://faraday.com',
      :params => {:page => 1}

Returns a Faraday::Connection.

    # File lib/faraday.rb, line 67
    def new(url = nil, options = nil)
      block = block_given? ? Proc.new : nil
      options = options ? default_connection_options.merge(options) : default_connection_options.dup
      Faraday::Connection.new(url, options, &block)
    end

require_lib(*libs) click to toggle source
Alias for: require_libs
require_libs(*libs) click to toggle source

Internal: Requires internal Faraday libraries.

*libs - One or more relative String names to Faraday classes.

Returns nothing.

    # File lib/faraday.rb, line 78
    def require_libs(*libs)
      libs.each do |lib|
        require "#{lib_path}/#{lib}"
      end
    end

Also aliased as: require_lib

[Validate]

Generated with the Darkfish Rdoc Generator 2.