pkgdocs/compare/httpx vs uvicorn

Comparing

Python

httpx

The next generation HTTP client

119.1M/ wk
v0.28.1
vs
Python

uvicorn

Lightning-fast ASGI server for running async Python web apps (FastAPI, Starlette).

7.2M/ wk
v0.30.6
Metrichttpxuvicorn
EcosystemPythonPython
DifficultyIntermediateBeginner ✓
Weekly downloads119.1M↑7.2M
Latest versionv0.28.1v0.30.6
Recipes22

Tags

httpx only

httpasynciohttp2api-clientwww/httppythontrio

Shared

async

uvicorn only

asgiserverfastapiproduction

When to use each

httpx

Use httpx when building FastAPI or asyncio applications that call external APIs. Also reach for it when you need HTTP/2 support, a requests-compatible API with async support, or a single library that works in both sync and async contexts.

uvicorn

Running any ASGI framework: FastAPI, Starlette, Django Channels, Litestar. Development server with hot reload. Production with Gunicorn+uvicorn workers.

When to skip each

httpx

For simple synchronous scripts where you already use requests, there's little reason to switch — requests has a larger ecosystem of auth libraries and middleware. For high-volume async scraping at scale, aiohttp's lower-level control may be more efficient.

uvicorn

WSGI apps (Flask, Django without Channels) — use gunicorn with sync workers instead.

Sample recipes

httpx

  • Introduction
  • Installation

uvicorn

  • Run a FastAPI app for development
  • Production deploy with Gunicorn + Uvicorn workers