Skip to main content

Python-httpx Vs Python-requests

·67 words·1 min
Table of Contents
#!/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.

RequestsHTTPX
Sessionsrequests.Session()httpx.Client()
Async supportnot supportedhttpx.AsyncClient()
HTTP/2 supportnot supportedhttpx.Client(http2=True)
httpx.AsyncClient(http2=True)

Links#

Related