module Compropago::Connection

Public Instance Methods

api_connection() click to toggle source
# File lib/compropago/connection.rb, line 7
def api_connection
  @api_connection = Faraday.new(:url => Compropago.configuration.api_url) do |faraday|
    faraday.request  :basic_authentication, Compropago.configuration.api_key
    faraday.request  :url_encoded             # form-encode POST params
    faraday.response :logger                  # log requests to STDOUT
    faraday.response :raise_error
    #faraday.use FaradayMiddleware::RaiseHttpException
    faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP
  end
end