Skip to content

v2.1.0 — native async, streaming and typed APIs

Choose a tag to compare

@lxjmaster lxjmaster released this 05 Oct 05:45
· 7 commits to master since this release

Highlights

  • Native AsyncSession, AsyncResponse and AsyncConnectionPool, retaining
    project-owned TLS 1.2/1.3, ClientHello controls and HTTP/2 state.
  • Incremental HTTP/1.1 and HTTP/2 responses, including gzip/deflate/Brotli
    decoding, explicit response ownership and stream-scoped HTTP/2 cancellation.
  • Public inline types and py.typed, installed-consumer type checks, local
    MkDocs guides/API references and reproducible sync/async performance tooling.
  • Reviewed fixes for TLS CBC record validation, bounded HTTP/2 headers, GOAWAY
    retry policy, response/hook cleanup, Cookie scope and request isolation, and
    bodyless synchronous redirects. Async close also clears Python 3.7 socket
    event registrations before the descriptor can be reused.

Compatibility and upgrade notes

  • Python remains >=3.7; Brotli now requires >=1.2.0 for bounded decoding.
  • Secure TLS defaults and the project-owned protocol implementation are unchanged.
  • HTTPRetry.raise_on_status=True now raises on final retryable status exhaustion
    as configured; use False to return that response instead.
  • Streaming iteration is single-consumer and does not cache a replay copy. Close
    responses when stopping early; an unread HTTP/1 response discards its connection.
  • Async decoding is strict and .content is cache-only. Async 307/308 redirects
    retain method/body; synchronous redirects retain their existing GET policy.
  • Async file uploads, Cookie-file helpers, prepared-request APIs and module-level
    convenience functions remain outside this first async scope. HTTP/3, 0-RTT,
    ECH and post-quantum groups are not added.

See CHANGELOG,
async guide
and streaming guide.