Method: Gem::Net::HTTPHeader#basic_auth
- Defined in:
- lib/rubygems/net-http/lib/net/http/header.rb
#basic_auth(account, password) ⇒ Object
Sets header 'Authorization' using the given account and password strings:
req.basic_auth('my_account', 'my_password')
req['Authorization']
# => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA=="
945 946 947 |
# File 'lib/rubygems/net-http/lib/net/http/header.rb', line 945 def basic_auth(account, password) @header['authorization'] = [basic_encode(account, password)] end |