Method: HTTPClient#set_auth

Defined in:
lib/httpclient.rb

#set_auth(domain, user, passwd) ⇒ Object

Sets credential for Web server authentication.

domain

a String or an URI to specify where HTTPClient should use this

credential.  If you set uri to nil, HTTPClient uses this credential
wherever a server requires it.
user

username String.

passwd

password String.

You can set multiple credentials for each uri.

clnt.set_auth('http://www.example.com/foo/', 'foo_user', 'passwd')
clnt.set_auth('http://www.example.com/bar/', 'bar_user', 'passwd')

Calling this method resets all existing sessions.



444
445
446
447
448
# File 'lib/httpclient.rb', line 444

def set_auth(domain, user, passwd)
  uri = urify(domain)
  @www_auth.set_auth(uri, user, passwd)
  reset_all
end