/usr/share/doc/ruby-httpclient/examples/auth.rb is in ruby-httpclient 2.3.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 | require 'httpclient'
c = HTTPClient.new
c.debug_dev = STDOUT
# for Proxy authentication: supports Basic, Negotiate and NTLM.
#c.set_proxy_auth("admin", "admin")
# for WWW authentication: supports Basic, Digest and Negotiate.
c.set_auth("http://dev.ctor.org/http-access2/", "user", "user")
p c.get("http://dev.ctor.org/http-access2/login")
|