httpx

Automate outbound HTTP client patterns in Python with HTTPX.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/oornnery/skills --skill httpx-oornnery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: httpx
Source: https://github.com/oornnery/skills/tree/main/skills/httpx
Command: npx skills add https://github.com/oornnery/skills --skill httpx-oornnery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

Establishes consistent, observable outbound HTTP patterns for Python services using HTTPX, reducing boilerplate and accidental misconfigurations.

Core Features & Use Cases

  • Centralized client lifecycle with shared configuration (base_url, timeouts, headers)
  • Sync and async usage with clear separation of adapters
  • Safe transport and testing patterns, including MockTransport for offline tests
  • Guardrails for security and reliability (timeouts, redirects, error handling)

Quick Start

Instantiate a configured httpx.Client or httpx.AsyncClient with a base_url and timeouts, then reuse it across your codebase.

Frequently Asked Questions about httpx

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

FAQPage Schema
How do I configure a shared HTTPX client with base_url and timeouts in Python?

To configure a shared HTTPX client, instantiate a configured httpx.Client or httpx.AsyncClient with a base_url and explicit timeouts, then reuse it across your codebase to reduce boilerplate and ensure consistent outbound HTTP patterns.

What is the best way to mock HTTPX requests for offline Python testing?

The best way to mock HTTPX requests for offline testing is using the MockTransport pattern. This allows you to intercept outbound HTTP calls and simulate responses without requiring live network connectivity during your test suite.

Can I use HTTPX for both sync and async HTTP calls in the same Python service?

Yes, you can use HTTPX for both sync and async HTTP calls by utilizing clear separation between adapters. The library provides distinct httpx.Client and httpx.AsyncClient classes to support both execution models within the same service.

Why should I set explicit timeouts on outbound HTTPX requests?

You should set explicit timeouts on outbound HTTPX requests to enforce reliability guardrails. Configuring timeouts prevents hanging requests and ensures your Python service degrades gracefully when downstream integrations become unresponsive.