MCPcopy Index your code
hub / github.com/0x676e67/wreq

github.com/0x676e67/wreq @v5.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.3.0 ↗ · + Follow
1,245 symbols 4,036 edges 97 files 287 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

wreq

CI Crates.io License Crates.io MSRV crates.io Crates.io Total Downloads

🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

An ergonomic all-in-one HTTP client for browser emulation with TLS, JA3/JA4, and HTTP/2 fingerprints.

Features

  • Plain bodies, JSON, urlencoded, multipart
  • Cookie Store
  • Header Order
  • Redirect Policy
  • Rotating Proxies
  • Certificate Store
  • WebSocket Upgrade
  • HTTPS via BoringSSL
  • HTTP/2 over TLS Emulation

Example

This asynchronous example utilizes Tokio with optional features enabled, requiring the following configuration in Cargo.toml:

[dependencies]
tokio = { version = "1", features = ["full"] }
wreq = "5"
wreq-util = "2"

And then the code:

```rust,no_run use wreq::Client; use wreq_util::Emulation;

[tokio::main]

async fn main() -> Result<(), wreq::Error> { // Build a client let client = Client::builder() .emulation(Emulation::Firefox136) .build()?;

// Use the API you're already familiar with
let resp = client.get("https://tls.peet.ws/api/all").send().await?;
println!("{}", resp.text().await?);

Ok(())

}


## Emulation

- **HTTP/2 over TLS**

  **JA3**/**JA4**/**Akamai** fingerprints cannot accurately simulate browser fingerprints due to the sophistication of TLS encryption and the popularity of HTTP/2. wreq does not plan to support parsing these fingerprint strings for simulation. Users are encouraged to customize the configuration according to their own needs.

- **Emulation Device**

  Most browser device models share the same TLS and HTTP/2 configuration, differing only in the User-Agent. The browser device emulation template is managed by [wreq-util](https://github.com/0x676e67/wreq-util).

## Building

Avoid compiling with packages that depend on `openssl-sys`, as it shares the same prefix symbol with `boring-sys`, potentially leading to [link failures](https://github.com/cloudflare/boring/issues/197) and other issues. Even if compilation succeeds, using both `openssl-sys` and `boring-sys` together can result in memory segmentation faults. Until the upstream Boring resolves these linking conflicts, using `rustls` is the best workaround.

Install the dependencies required to build [BoringSSL](https://github.com/google/boringssl/blob/master/BUILDING.md#build-prerequisites)

```shell
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools -y

cargo build --release

This GitHub Actions workflow can be used to compile the project on Linux, Windows, and macOS.

License

Released under the Apache-2.0 License.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Sponsors

CapSolver leverages AI-powered Auto Web Unblock to bypass Captchas effortlessly, providing fast, reliable, and cost-effective data access with seamless integration into Colly, Puppeteer, and Playwright—use code RQUEST for a 6% bonus!

Accolades

The project is based on a fork of reqwest.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 712
Function 343
Class 134
Interface 29
Enum 27

Languages

Rust100%

Modules by API surface

src/proxy.rs108 symbols
src/client/http.rs102 symbols
src/util/client/mod.rs62 symbols
src/client/request.rs47 symbols
src/util/client/connect/http.rs45 symbols
src/error.rs45 symbols
src/util/client/pool.rs44 symbols
src/client/multipart.rs39 symbols
src/client/websocket/mod.rs38 symbols
src/connect.rs37 symbols
src/cookie.rs36 symbols
src/tls/x509/store.rs30 symbols

For agents

$ claude mcp add wreq \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page