Registry / http-networking / niquests

niquests

JSON →
library3.21.1pypypi✓ verified 23d ago

Niquests is a simple, yet elegant, HTTP library designed as a drop-in replacement for Requests, which is currently under feature freeze. It aims to extend Requests' capabilities with modern features like async support, ASGI/WSGI integration, and experimental WebAssembly compatibility. The current version is 3.18.5, and it maintains an active release cadence with frequent updates.

pip install niquests
INSTALL
IMPORT
SIG · NIQUESTS
N
niquests
http-networkingpythonv3.21.1
Install
3.2s avg
Import
592ms
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.21.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.600s · 38MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.2s · import 0.584s · 37MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get
import niquests response = niquests.get('https://httpbin.org/get')
import requests response = requests.get('https://httpbin.org/get')
While Niquests is a drop-in replacement, directly using `niquests.get` ensures access to Niquests-specific features and avoids potential conflicts if `requests` is also installed.
post
import niquests response = niquests.post('https://httpbin.org/post', json={'key': 'value'})
Similar to `get`, direct import of `niquests` is recommended for new code.
Session
from niquests import Session session = Session()
from requests import Session session = Session()
Instantiate Niquests' `Session` object directly to utilize its enhanced features and thread-safety.
AsyncSession
from niquests import AsyncSession async_session = AsyncSession()
Use `AsyncSession` for asynchronous operations, which requires an `anyio` backend to be installed.

This quickstart demonstrates both synchronous and asynchronous HTTP requests using Niquests. It performs a simple GET request using the top-level API and a POST request using an `AsyncSession` for concurrent operations.

import niquests import asyncio def sync_example(): print('--- Sync Example ---') response = niquests.get('https://httpbin.org/get') response.raise_for_status() print(f"Sync GET status: {response.status_code}") print(f"Sync GET JSON: {response.json()['headers']['Host']}") async def async_example(): print('\n--- Async Example ---') async with niquests.AsyncSession() as session: response = await session.post('https://httpbin.org/post', json={'test': 'data'}) response.raise_for_status() print(f"Async POST status: {response.status_code}") print(f"Async POST JSON: {response.json()['json']}") if __name__ == '__main__': sync_example() asyncio.run(async_example())
Debug
Known issues
gotchaWhile Niquests is a drop-in replacement for Requests, subtle behavioral differences may exist. For instance, the default `keepalive_delay` was lowered from 1 hour to 10 minutes in v3.18.3, which can affect long-lived connections.
fix
Review Niquests' release notes and documentation for specific behavioral changes. Adjust `Session` parameters like `keepalive_delay` if needed to match previous Requests' behavior.
affects: >=3.18.3
gotchaCompatibility issues for `isinstance` checks relying on `niquests.packages` were present in earlier versions, leading to potential type-checking failures. This was fixed in v3.18.4, but suggests reliance on internal `requests`-like structure can be brittle.
fix
Upgrade to Niquests v3.18.4 or later to ensure correct type behavior and compatibility with code expecting Requests' internal structure.
affects: <3.18.4
gotchaExperimental features like WebAssembly (WASM) support introduced in v3.18.0 require specific environments (e.g., Chrome v137+, Firefox v131+, Node v22+) and often require enabling JavaScript Promise Integration (JSPI) explicitly.
fix
Consult Niquests' documentation for WASM environment setup and ensure all prerequisites, including JSPI, are met for successful execution in WebAssembly contexts. Treat as experimental functionality.
affects: >=3.18.0
gotchaAdvanced features such as the `rtls` alternative TLS backend (v3.18.3) or native `http+unix` connections (v3.17.0) may require additional `pip install` dependencies or specific environmental configurations beyond the basic `niquests` install.
fix
Refer to Niquests' documentation for detailed installation instructions and dependency requirements for specific advanced features.
affects: >=3.17.0
Upgrade
Version history
3.21.1latest on PyPI · released Aug 28, 2026
Audit
Dependencies
httpcorerequiredCore underlying HTTP client library used by Niquests.
h11requiredHTTP/1.1 protocol implementation.
anyiooptionalRequired for async functionality (AsyncSession).
h2optionalEnables HTTP/2 protocol support.
brotlioptionalFor Brotli compression support.
zstandardoptionalFor Zstandard compression support.
rtlsoptionalAlternative TLS backend as disclosed in v3.18.3.
Agent activity
14 hits · last 30 days
node
10
Amazon
1
Resources
niquests — pip install niquests · libregistry