14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/microsoft_kiota_faraday/kiota_client_factory.rb', line 14
def self.get_default_http_client(middleware=nil, default_middleware_options=Array.new)
if middleware.nil? middleware = self.get_default_middleware()
end
connection_options = Hash.new
connection_options[:request] = Hash.new
connection_options[:request][:context] = Hash.new
unless default_middleware_options.nil? || default_middleware_options.empty? then
default_middleware_options.each do |value|
connection_options[:request][:context][value.get_key] = value
end
end
conn = Faraday::Connection.new(nil, connection_options) do |builder|
builder.adapter Faraday.default_adapter
builder.ssl.verify = true
builder.ssl.verify_mode = OpenSSL::SSL::VERIFY_PEER
middleware.each do |handler|
builder.use handler
end
end
conn
end
|