This release is a pre-release and may not be stable for production use.
reqrio-py
reqrio-py is the Python binding for reqrio, a lightweight and high-concurrency HTTP request library.
Features
- High-performance HTTP/HTTPS request engine with low-copy semantics.
- Built-in TLS support using BoringSSL.
- Supports HTTP/1.1 and HTTP/2.0 via
ALPN; HTTP/3 and QUIC are available in the native library when thequicfeature is enabled. - Supports custom headers, cookies, timeouts, proxies, and certificate verification.
- Supports form data, JSON, text, bytes, and multipart file uploads.
- Includes a WebSocket client wrapper.
Installation
pip install reqrio
Python 3.9 or newer is required.
Quick Start
import reqrio
session = reqrio.Session(
headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
},
alpn=reqrio.ALPN.HTTP20,
verify=True,
)
session.set_timeout(3000, 3000, 3000, 30000)
response = session.get("https://www.example.com")
print(response.statue_code())
print(response.text())
session.close()
API Reference
reqrio.Session
Create a session:
session = reqrio.Session(
headers=None,
alpn=reqrio.ALPN.HTTP11,
verify=True,
proxy=None,
key_log=None,
ja3=None,
ja4=None,
client_hello=None,
random_tls=False,
custom_tls=None,
token="",
)
Common methods:
session.set_headers(headers: dict)session.add_header(name: str, value: str)session.remove_header(name: str)session.set_timeout(connect, read, write, handle, connect_times=3, handle_times=3)session.set_cookie(cookie: str)session.add_cookie(name: str, value: str)session.get(url, params=None, data=None, json=None, bytes=None, text=None, **kwargs)session.post(url, params=None, data=None, json=None, bytes=None, text=None, **kwargs)session.open_stream(method, url, params=None, data=None, json=None, bytes=None, text=None, **kwargs)session.close()
Helper functions
reqrio also offers shortcut functions for single requests:
resp = reqrio.get(
"https://www.example.com",
headers={"User-Agent": "..."},
params={"q": "test"},
)
print(resp.statue_code())
resp = reqrio.post(
"https://www.example.com/api",
headers={"Content-Type": "application/json"},
json={"key": "value"},
)
print(resp.statue_code())
WebSocket support
from reqrio import WebSocket, WsOpCode
headers = {
"Origin": "https://example.com",
"User-Agent": "Mozilla/5.0...",
}
ws = WebSocket(
"wss://example.com/",
uri="wss://example.com/api/ws",
headers=headers,
)
ws.open()
while True:
frame = ws.read()
if frame.opcode == WsOpCode.PING:
ws.write(WsOpCode.PONG, frame.payload)
else:
print(frame.payload.decode("utf-8"))
ws.close()
Request Body Types
Supported request bodies:
data={...}for form datajson={...}for JSON payloadstext="..."for plain textbytes=b"..."for raw bytesfiles=[...]for multipart file upload
File upload example:
files = [
{
"path": "./example.txt",
"field_name": "file",
"filetype": "text/plain",
}
]
response = session.post(
"https://www.example.com/upload",
data={"name": "test"},
files=files,
)
print(response.statue_code())
TLS Fingerprinting and Advanced Options
reqrio.Session supports advanced TLS configuration:
ja3: JA3 fingerprint stringja4: JA4 fingerprint stringclient_hello: raw TLS ClientHello bytesrandom_tls: random TLS fingerprintcustom_tls: custom TLS configuration dictionarytoken: fingerprint authentication token
Additional options:
verify=Falseto disable certificate verificationproxyfor HTTP/SOCKS proxy supportkey_logto save TLS key material for debugging
Notes
reqrio-pyis designed to reuse connections when possible.- Be sure to call
session.close()to release resources.
License
Apache-2.0
Metadata
Release files for reqrio 0.4.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| reqrio-0.4.0rc1.tar.gz | 3.7 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| reqrio-0.4.0rc1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 MB
Release files / reqrio-0.4.0rc1.tar.gz
| Download URL | reqrio-0.4.0rc1.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ef0a6e81115392e3a41cf8f3c6343b42c7293ef0187e87027d68b15a2105882
|
|
BLAKE2b-256 checksum How to use checksums |
a0c0db557b4fd17a1aa9d393056a939f81a2174df78198ae25160cca309c49b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / reqrio-0.4.0rc1-py3-none-any.whl
| Download URL | reqrio-0.4.0rc1-py3-none-any.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b0e4f93f7e4c950be57578b05860e2fee47a5e3d014db5b7e72f69ecc188e96
|
|
BLAKE2b-256 checksum How to use checksums |
0be7cc62d1e8c5f983ec9ad4021cefe971768c0cedbde479296cf99253b11fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for reqrio 0.4.0rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.