10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/traitify/client/connection.rb', line 10
def connection(options = {})
Faraday.new(options) do |faraday|
faraday.request(:authorization, :basic, secret_key || public_key, "x")
faraday.request(:json)
faraday.request(:retry, retry_options) if auto_retry
faraday.["Accept"] = "application/json"
faraday.options.params_encoder = Faraday::FlatParamsEncoder
faraday.response(:logger, Traitify.logger, formatter: Traitify::Middleware::Formatter)
faraday.response(:raise_traitify_error)
faraday.response(:json)
faraday.adapter(:net_http)
end
end
|