httpx

Implement httpx HTTP clients with sync and async APIs.

15|2|Updated May 23, 2026
One-click install
npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill httpx-vkirill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: httpx
Source: https://github.com/VKirill/antigravity-for-claude-code/tree/main/skills/httpx
Command: npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill httpx-vkirill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents broken HTTP integrations by guiding you to use httpx’s correct lifecycle, timeouts, error handling, redirects, streaming, and testing patterns instead of relying on unsafe defaults or requests-style assumptions.

Core Features & Use Cases

  • Sync + Async client correctness: context-managed Client/AsyncClient, connection pooling, and safe reuse across a process.
  • Resilient request handling: explicit per-phase timeouts, raise_for_status() usage, and correct exception distinction (RequestError vs HTTPStatusError).
  • Real-world HTTP coverage: auth (Basic/Digest/NetRC/custom httpx.Auth), proxies/TLS/mTLS, HTTP/2 opt-in, and streaming downloads/uploads.
  • Testing without real ports: MockTransport, ASGITransport, WSGITransport, plus respx and pytest-httpx guidance.

Quick Start

Use the httpx skill to migrate your existing requests code to an async AsyncClient with correct redirect handling and explicit timeouts for production reliability.

Frequently Asked Questions about httpx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from requests to an async HTTP client in Python?

Migrate from requests to an async HTTP client by using httpx `AsyncClient` with context-managed lifecycles, explicit per-phase timeouts, and correct redirect handling for production reliability.

How does streaming work with an async HTTP client for large payloads?

Streaming with an async HTTP client works by using context-managed `Client` or `AsyncClient` instances to safely handle large payload downloads and uploads without loading the entire response body into memory at once.

Can I test HTTP client requests without real network ports in Python?

Yes, you can test HTTP client requests without real network ports by using in-memory `MockTransport`, `ASGITransport`, and `WSGITransport` to route requests directly to your ASGI/WSGI applications.

What is the best way to handle HTTP client timeouts and exceptions?

Handle HTTP client timeouts and exceptions by configuring explicit per-phase timeouts and using `raise_for_status()` to properly distinguish between `RequestError` connection issues and `HTTPStatusError` response failures.

Does httpx support HTTP/2 and TLS mTLS proxy configurations?

Yes, httpx supports optional HTTP/2 opt-in, proxy routing, and TLS/mTLS configuration, alongside authentication methods including Basic, Digest, NetRC, and custom `httpx.Auth` implementations for secure outbound networking.

Why should I use a context-managed HTTP client lifecycle instead of default requests?

Use a context-managed HTTP client lifecycle to ensure proper connection pooling and safe client reuse across a process, preventing broken HTTP integrations caused by relying on unsafe defaults or requests-style assumptions.