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 '/'
UploadIO | = | ::UploadIO |
Parts | = | ::Parts |
VERSION | = | "0.9.2" |
Timer | = | SystemTimer |
Timer | = | Timeout |
require_libs | -> | require_lib |
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: Updates default adapter while resetting default_connection.
Returns the new default_adapter.
Gets the default connection used for simple scripts.
Returns a Faraday::Connection, configured with the default_adapter.
Gets the default connection options used when calling Faraday#new.
Returns a Faraday::ConnectionOptions.
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.