lib/fulfil_api/client.rb in fulfil_api-0.1.3 vs lib/fulfil_api/client.rb in fulfil_api-0.1.4
- old
+ new
@@ -56,11 +56,14 @@
@api_endpoint ||= "https://#{configuration.merchant_id}.fulfil.io"
end
# @return [Faraday::Connection]
def connection
- # TODO: Allow passing configuration options for the request
- @connection ||= Faraday.new(headers: request_headers, url: api_endpoint) do |connection|
+ @connection ||= Faraday.new(
+ headers: request_headers,
+ url: api_endpoint,
+ request: configuration.request_options
+ ) do |connection|
connection.adapter :net_http_persistent # TODO: Allow passing configuration options
# Configuration of the request middleware
connection.request :json