Module: Compropago::Connection
- Defined in:
- lib/compropago/connection.rb
Instance Method Summary collapse
Instance Method Details
#api_connection ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# 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 |