Method: PassaporteWeb::Http.custom_auth_get

Defined in:
lib/passaporte_web/http.rb

.custom_auth_get(user, password, path = '/', params = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/passaporte_web/http.rb', line 23

def self.custom_auth_get(user, password, path='/', params={})
  credentials = "Basic #{::Base64.strict_encode64("#{user}:#{password}")}"
  custom_params = common_params('application').merge({authorization: credentials})
  RestClient.get(
    pw_url(path),
    {params: params}.merge(custom_params)
  )
end