#!/usr/bin/evn python3
# -*- coding: utf-8 -*-
import asyncio
import httpx
import requests
Requests vs HTTPX#
In general, both the module are similar, Here, I just make a simple comparison on what are the differences between Python HTTPX and Requests module.
| Requests | HTTPX | |
|---|---|---|
| Sessions | requests.Session() | httpx.Client() |
| Async support | not supported | httpx.AsyncClient() |
| HTTP/2 support | not supported | httpx.Client(http2=True) httpx.AsyncClient(http2=True) |
