Module: HTTPX::Plugins::BasicAuthentication::InstanceMethods

Defined in:
lib/httpx/plugins/basic_authentication.rb

Instance Method Summary collapse

Instance Method Details

#basic_authentication(user, password) ⇒ Object Also known as: basic_auth



17
18
19
# File 'lib/httpx/plugins/basic_authentication.rb', line 17

def basic_authentication(user, password)
  authentication("Basic #{Base64.strict_encode64("#{URI.escape(user)}:#{URI.escape(password)}")}")
end