Skip to content
Myr

Document digest auth (#348)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Document authentication * Fix linting errors * Tweak wording * Update docs/quickstart.md

authored by Yeray Diaz Diaz · committed by GitHub · parent 6c6148e · Browse files · 4 files+24 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>

Diff stats

4 files+24 added−3 removed

  • tests:+0 added−1 removed
  • other:+24 added−2 removed

4 files+24 added−3 removed

modified:docs/quickstart.md+22 added
377 unmodified lines
378379```python380>>> httpx.get('https://github.com/', timeout=0.001)381```382383## Authentication384385HTTPX supports Basic and Digest HTTP authentication.386387To provide Basic authentication credentials, pass a 2-tuple of388plaintext `str` or `bytes` objects as the `auth` argument to the request389functions:390391```python392>>> httpx.get("https://example.com", auth=("my_user", "password123"))393```394395To provide credentials for Digest authentication you'll need to instantiate396a `DigestAuth` object with the plaintext username and password as arguments.397This object can be then passed as the `auth` argument to the request methods398as above:399400```python401>>> auth = httpx.DigestAuth("my_user", "password123")402>>> httpx.get("https://example.com", auth=auth)403<Response [200 OK]>
modified:tests/requests_compat/test_api.py-1 removed
1"""Test compatibility with the Requests high-level API."""2import pytest33import requests456@pytest.mark.copied_from(
23 unmodified lines
modified:README.md+1 added-1 removed
modified:setup.cfg+1 added-1 removed
9 unmodified lines
10combine_as_imports = True11force_grid_wrap = 012include_trailing_comma = True13known_first_party = httpx,tests14known_third_party = brotli,certifi,chardet,cryptography,h11,h2,hstspreload,nox,pytest,rfc3986,setuptools,trustme,uvicorn14known_third_party = brotli,certifi,chardet,cryptography,h11,h2,hstspreload,nox,pytest,requests,rfc3986,setuptools,trustme,uvicorn15line_length = 8816multi_line_output = 31718[tool:pytest]
3 unmodified lines