Class | Faraday::Connection |
In: |
lib/faraday/connection.rb
|
Parent: | Object |
METHODS | = | Set.new [:get, :post, :put, :delete, :head, :patch, :options] |
METHODS_WITH_BODIES | = | Set.new [:post, :put, :patch, :options] |
builder | [R] | |
default_parallel_manager | [W] | |
headers | [R] | |
options | [R] | |
parallel_manager | [R] | |
params | [R] | |
ssl | [R] | |
url_prefix | [R] |
Internal: Build an absolute URL based on url_prefix.
url - A String or URI-like object params - A Faraday::Utils::ParamsHash to replace the query values
of the resulting url (default: nil).
Returns the resulting URI instance.
Takes a relative url for a request and combines it with the defaults set on the connection instance.
conn = Faraday::Connection.new { ... } conn.url_prefix = "https://sushi.com/api?token=abc" conn.scheme # => https conn.path_prefix # => "/api" conn.build_url("nigiri?page=2") # => https://sushi.com/api/nigiri?token=abc&page=2 conn.build_url("nigiri", :page => 2) # => https://sushi.com/api/nigiri?token=abc&page=2
Internal: Traverse the middleware stack in search of a parallel-capable adapter.
Yields in case of not found.
Returns a parallel manager or nil if not found.
Parses the giving url with URI and stores the individual components in this connection. These components serve as defaults for requests made by this connection.
conn = Faraday::Connection.new { ... } conn.url_prefix = "https://sushi.com/api" conn.scheme # => https conn.path_prefix # => "/api" conn.get("nigiri?page=2") # accesses https://sushi.com/api/nigiri