Module: Vindi::Connection

Included in:
Request
Defined in:
lib/vindi/connection.rb

Instance Method Summary collapse

Instance Method Details

#http_clientObject

HTTP client for the Vindi API

Returns:

  • Faraday::Connection



14
15
16
17
18
19
20
21
22
# File 'lib/vindi/connection.rb', line 14

def http_client
  @http_client = Faraday.new(api_endpoint, connection_options) do |http|
    http.request(:multipart)
    http.request(:url_encoded)
    http.set_basic_auth(@key, '')
    http.builder.use @middleware
    http.adapter(Faraday.default_adapter)
  end
end

#last_responseObject



24
25
26
# File 'lib/vindi/connection.rb', line 24

def last_response
  @last_response if defined?(@last_response)
end