app/models/user.rb
# The faraday connection to rvs including authorization if present
The faraday connection to rvs including authorization if present
The faraday connection to rvs including authorization if present
def rvs_connection
    connection = Faraday.new url: Rails.application.secrets.rvs_url do |faraday|
      faraday.request  :url_encoded                                              
      faraday.response :logger if Rails.env.development? || ENV['DEBUG_FARADAY'] 
      faraday.adapter  Faraday.default_adapter                                   
    end
    connection.headers['Authorization'] = "Token #{rvs_key}" if rvs_key
    return connection
  end
def rvs_connection connection = Faraday . new url : Rails . application . secrets . rvs_url do | faraday | faraday . request :url_encoded faraday . response :logger if Rails . env . development? || ENV [ 'DEBUG_FARADAY' ] faraday . adapter Faraday . default_adapter end connection . headers [ 'Authorization' ] = "Token #{rvs_key}" if rvs_key return connection end
The faraday connection to rvs including authorization if present
The faraday connection to rvs including authorization if present
# form-encode POST params # log requests to STDOUT # make requests with Net::HTTP