Class Faraday::RackBuilder
In: lib/faraday/rack_builder.rb
Parent: Object

A Builder that processes requests into responses by passing through an inner middleware stack (heavily inspired by Rack).

  Faraday::Connection.new(:url => 'http://sushi.com') do |builder|
    builder.request  :url_encoded  # Faraday::Request::UrlEncoded
    builder.adapter  :net_http     # Faraday::Adapter::NetHttp
  end

Methods

==   []   adapter   app   build   build_env   build_response   delete   dup   insert   insert_after   insert_before   lock!   locked?   new   request   response   swap   to_app   use  

Classes and Modules

Class Faraday::RackBuilder::Handler
Class Faraday::RackBuilder::StackLocked

Attributes

handlers  [RW] 

Public Class methods

Public Instance methods

The "rack app" wrapped in middleware. All requests are sent here.

The builder is responsible for creating the app object. After this, the builder gets locked to ensure no further modifications are made to the middleware stack.

Returns an object that responds to `call` and returns a Response.

ENV Keys :method - a symbolized request method (:get, :post) :body - the request body that will eventually be converted to a string. :url - URI instance for the current request. :status - HTTP response status code :request_headers - hash of HTTP Headers to be sent to the server :response_headers - Hash of HTTP headers from the server :parallel_manager - sent if the connection is in parallel mode :request - Hash of options for configuring the request.

  :timeout      - open/read timeout Integer in seconds
  :open_timeout - read timeout Integer in seconds
  :proxy        - Hash of proxy options
    :uri        - Proxy Server URI
    :user       - Proxy server username
    :password   - Proxy server password

:ssl - Hash of options for configuring SSL requests.

Processes a Request into a Response by passing it through this Builder‘s middleware stack.

connection - Faraday::Connection request - Faraday::Request

Returns a Faraday::Response.

methods to push onto the various positions in the stack:

insert_before(index, *args, &block)

Alias for insert

Locks the middleware stack to ensure no further modifications are possible.

[Validate]