File: auth.rb

package info (click to toggle)
ruby-httpclient 2.8.3%2Bgit20211122.4658227-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,908 kB
  • sloc: ruby: 9,963; makefile: 10; sh: 2
file content (11 lines) | stat: -rw-r--r-- 350 bytes parent folder | download
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/", "username", "password")
p c.get("http://dev.ctor.org/http-access2/login")