Skip to content
masterclass Buddy

HTTPX · Class

MockTransport

HTTPX MockTransport replaces real network calls with responses returned by a handler. It is useful for predictable tests.

Last updated

Syntax

httpx.MockTransport(handler)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • HTTPTransport
  • BaseTransport
  • Client
  • Mock transports

Source: Transports - HTTPX. Checked 2026-11-03.