httpx.Auth object to get full control over request authentication.
Built-in Options
- Basic Auth
- Digest Auth
- NetRC
HTTP Basic Auth encodes username:password in Base64:
Custom Implementations
Create your own by subclassinghttpx.Auth:
API Key in Header
API Key in Header
API Key in Query Parameter
API Key in Query Parameter
Request Signing (HMAC)
Request Signing (HMAC)
For APIs requiring request signatures:
Multiple Headers
Multiple Headers
Add several authentication headers at once:
Combining with Headers
You can use bothauth and headers together:
The
auth object handles dynamic authentication while headers adds static headers to every request.