lib/faraday/connection.rb in faraday-2.5.2 vs lib/faraday/connection.rb in faraday-2.6.0
- old
+ new
@@ -128,14 +128,14 @@
# @!method get(url = nil, params = nil, headers = nil)
# Makes a GET HTTP request without a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param params [Hash] Hash of URI query unencoded key/value pairs.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.get '/items', { page: 1 }, :accept => 'application/json'
#
# # ElasticSearch example sending a body with GET.
@@ -150,14 +150,14 @@
# @!method head(url = nil, params = nil, headers = nil)
# Makes a HEAD HTTP request without a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param params [Hash] Hash of URI query unencoded key/value pairs.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.head '/items/1'
#
# @yield [Faraday::Request] for further request customizations
@@ -165,14 +165,14 @@
# @!method delete(url = nil, params = nil, headers = nil)
# Makes a DELETE HTTP request without a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param params [Hash] Hash of URI query unencoded key/value pairs.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.delete '/items/1'
#
# @yield [Faraday::Request] for further request customizations
@@ -180,14 +180,14 @@
# @!method trace(url = nil, params = nil, headers = nil)
# Makes a TRACE HTTP request without a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param params [Hash] Hash of URI query unencoded key/value pairs.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.connect '/items/1'
#
# @yield [Faraday::Request] for further request customizations
@@ -208,13 +208,13 @@
# @overload options()
# Returns current Connection options.
#
# @overload options(url, params = nil, headers = nil)
# Makes an OPTIONS HTTP request to the given URL.
- # @param url [String] String base URL to sue as a prefix for all requests.
- # @param params [Hash] Hash of URI query unencoded key/value pairs.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param url [String, URI, nil] String base URL to sue as a prefix for all requests.
+ # @param params [Hash, nil] Hash of URI query unencoded key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.options '/items/1'
#
# @yield [Faraday::Request] for further request customizations
@@ -231,14 +231,14 @@
# @!method post(url = nil, body = nil, headers = nil)
# Makes a POST HTTP request with a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param body [String] body for the request.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param body [String, nil] body for the request.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# conn.post '/items', data, content_type: 'application/json'
#
# # Simple ElasticSearch indexing sample.
@@ -253,14 +253,14 @@
# @!method put(url = nil, body = nil, headers = nil)
# Makes a PUT HTTP request with a body.
# @!scope class
#
- # @param url [String] The optional String base URL to use as a prefix for
+ # @param url [String, URI, nil] The optional String base URL to use as a prefix for
# all requests. Can also be the options Hash.
- # @param body [String] body for the request.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param body [String, nil] body for the request.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @example
# # TODO: Make it a PUT example
# conn.post '/items', data, content_type: 'application/json'
#
@@ -388,11 +388,11 @@
end
# Takes a relative url for a request and combines it with the defaults
# set on the connection instance.
#
- # @param url [String]
+ # @param url [String, URI, nil]
# @param extra_params [Hash]
#
# @example
# conn = Faraday::Connection.new { ... }
# conn.url_prefix = "https://httpbingo.org/api?token=abc"
@@ -421,14 +421,14 @@
end
# Builds and runs the Faraday::Request.
#
# @param method [Symbol] HTTP method.
- # @param url [String, URI] String or URI to access.
- # @param body [Object] The request body that will eventually be converted to
+ # @param url [String, URI, nil] String or URI to access.
+ # @param body [String, nil] The request body that will eventually be converted to
# a string.
- # @param headers [Hash] unencoded HTTP header key/value pairs.
+ # @param headers [Hash, nil] unencoded HTTP header key/value pairs.
#
# @return [Faraday::Response]
def run_request(method, url, body, headers)
unless METHODS.include?(method)
raise ArgumentError, "unknown http method: #{method}"
@@ -460,10 +460,10 @@
end
end
# Build an absolute URL based on url_prefix.
#
- # @param url [String, URI]
+ # @param url [String, URI, nil]
# @param params [Faraday::Utils::ParamsHash] A Faraday::Utils::ParamsHash to
# replace the query values
# of the resulting url (default: nil).
#
# @return [URI]