Method: Faraday::Connection#basic_auth

Defined in:
lib/faraday/connection.rb

#basic_auth(login, pass) ⇒ Object

Public: Sets up the Authorization header with these credentials, encoded with base64.

login - The authentication login. pass - The authentication password.

Examples

conn.basic_auth 'Aladdin', 'open sesame'
conn.headers['Authorization']
# => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="

Returns nothing.



195
196
197
# File 'lib/faraday/connection.rb', line 195

def basic_auth(, pass)
  set_authorization_header(:basic_auth, , pass)
end