The Authentication header is composed of a base plugin, and two derived plugins.


The authentication plugin adds a method to add a self-generated token to the “authorization” header:

http = HTTPX.plugin(:authentication)

Basic Authentication

The basic authentication plugin can create an HTTP Basic Auth compatible header based on a username and password.

http = HTTPX.plugin(:basic_authentication)
http.basic_auth("user", "pass").get("")

Digest Authentication

The digest authentication plugin provides an API to authenticate requests using HTTP Digest access authentication

http = HTTPX.plugin(:digest_authentication)
http.digest_auth("user", "pass").get("")

Note: due to the required extra-roundtrip, requests will be executed one at a time.

NTLM Authentication

(available since v0.15.0).

The ntlm authentication plugin can provides an API to authenticate requests using NTLM authentication

http = HTTPX.plugin(:ntlm_authentication)
http.ntlm_auth("user", "pass", "Domain" ).get("")

Next: Follow Redirects