WREQ · PYTHON HTTP CLIENT
HTTP for Python,
powered by Rust.
wreq is a Python HTTP client built on Rust. Use it with async or blocking code, choose a browser profile, or tune TLS and HTTP/2 yourself. You can stream uploads and responses when you don't want the whole body in memory.
pip install wreqPython 3.11+ · Apache-2.0
SUPPORTED BY OUR SPONSORS
Thanks to our sponsors.
CLIENT FEATURES
What you can do with wreq
Choose a browser profile
Pick a browser and platform profile to configure TLS, HTTP/2 and the User-Agent together.
Emulation guide 02 · PERFORMANCEHigh-throughput HTTPS
Rust handles the network I/O. See how wreq compares with other Python clients, then choose the body size and runtime mode that matter to your workload.
View performance results 03 · STREAMINGStream uploads and responses
Send an upload in chunks or read a response as it arrives. Response chunks are read-only memoryviews backed by Rust buffers.
Streaming guide 04 · PYTHONAsync and blocking APIs
Use await in async code. For a synchronous script, import Client from wreq.blocking.
Blocking API 05 · RUNTIMEChoose how the client runs
Clients share a global Tokio runtime by default. Give a client its own runtime when you need separate resources or a single worker.
Runtime options 06 · WEBSOCKETConnect with WebSockets
Open a WebSocket connection through the client and send or receive text and binary frames.
WebSocket guideHTTPS BENCHMARKS
See the benchmark results
Choose a body size, protocol and concurrency level to see the results for your workload. We test complete and streamed uploads over HTTP/1.1 and HTTP/2, reading every response to the end. The tested commit, machine details and raw timings are there if you want to check or reproduce a result.