Need help with httpx?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

7.8K Stars 506 Forks BSD 3-Clause "New" or "Revised" License 1.1K Commits 59 Opened issues


A next generation HTTP client for Python. 🦋

Services available


Need anything else?

Contributors list


HTTPX - A next-generation HTTP client for Python.

Test Suite Package version

HTTPX is a fully featured HTTP client library for Python 3. It includes an integrated command line client, has support for both HTTP/1.1 and HTTP/2, and provides both sync and async APIs.

Note: The 0.20 release adds support for an integrated command-line client, and also includes a couple of design changes from 0.19. Redirects are no longer followed by default, and the low-level Transport API has been updated. Upgrades from 0.19 will need to see the CHANGELOG for more details.

Install HTTPX using pip:

$ pip install httpx

Now, let's get started:

>>> import httpx
>>> r = httpx.get('')
>>> r

>>> r.status_code
>>> r.headers['content-type']
'text/html; charset=UTF-8'
>>> r.text
'\n\n\nExample Domain...'

Or, using the command-line client.

$ pip install 'httpx[cli]'  # The command line client is an optional dependency.

Which now allows us to use HTTPX directly from the command-line...

httpx --help

Sending a request...



HTTPX builds on the well-established usability of

, and gives you:

Plus all the standard features of

  • International Domains and URLs
  • Keep-Alive & Connection Pooling
  • Sessions with Cookie Persistence
  • Browser-style SSL Verification
  • Basic/Digest Authentication
  • Elegant Key/Value Cookies
  • Automatic Decompression
  • Automatic Content Decoding
  • Unicode Response Bodies
  • Multipart File Uploads
  • HTTP(S) Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • .netrc Support
  • Chunked Requests


Install with pip:

$ pip install httpx

Or, to include the optional HTTP/2 support, use:

$ pip install httpx[http2]

HTTPX requires Python 3.6+.


Project documentation is available at

For a run-through of all the basics, head over to the QuickStart.

For more advanced topics, see the Advanced Usage section, the async support section, or the HTTP/2 section.

The Developer Interface provides a comprehensive API reference.

To find out about tools that integrate with HTTPX, see Third Party Packages.


If you want to contribute with HTTPX check out the Contributing Guide to learn how to start.


The HTTPX project relies on these excellent libraries:

  • httpcore
    - The underlying transport implementation for
    • h11
      - HTTP/1.1 support.
    • h2
      - HTTP/2 support. (Optional, with
  • certifi
    - SSL certificates.
  • charset_normalizer
    - Charset auto-detection.
  • rfc3986
    - URL parsing & normalization.
    • idna
      - Internationalized domain name support.
  • sniffio
    - Async library autodetection.
  • rich
    - Rich terminal support. (Optional, with
  • click
    - Command line client support. (Optional, with
  • brotli
    - Decoding for "brotli" compressed responses. (Optional, with
  • async_generator
    - Backport support for
    . (Only required for Python 3.6)

A huge amount of credit is due to

for the API layout that much of this work follows, as well as to
for plenty of design inspiration around the lower-level networking details.

— ⭐️ —

HTTPX is BSD licensed code. Designed & built in Brighton, England.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.