Debian Codegraph @

sample/auth.rb

raw
1 require 'httpclient'
2
3 c = HTTPClient.new
4 c.debug_dev = STDOUT
5
6 # for Proxy authentication: supports Basic, Negotiate and NTLM.
7 #c.set_proxy_auth("admin", "admin")
8
9 # for WWW authentication: supports Basic, Digest and Negotiate.
10 c.set_auth("http://dev.ctor.org/http-access2/", "username", "password")
11 p c.get("http://dev.ctor.org/http-access2/login")