MyGit

seanmonstar/reqwest

Fork: 1137 Star: 10047 (更新于 2024-12-14 03:09:13)

license: Apache-2.0

Language: Rust .

An easy and powerful Rust HTTP Client

最后发布版本: v0.12.8 ( 2024-10-01 02:14:22)

官方网址 GitHub网址

reqwest

crates.io Documentation MIT/Apache-2 licensed CI

An ergonomic, batteries-included HTTP Client for Rust.

  • Async and blocking Clients
  • Plain bodies, JSON, urlencoded, multipart
  • Customizable redirect policy
  • HTTP Proxies
  • HTTPS via system-native TLS (or optionally, rustls)
  • Cookie Store
  • WASM

Example

This asynchronous example uses Tokio and enables some optional features, so your Cargo.toml could look like this:

[dependencies]
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }

And then the code:

use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let resp = reqwest::get("https://httpbin.org/ip")
        .await?
        .json::<HashMap<String, String>>()
        .await?;
    println!("{resp:#?}");
    Ok(())
}

Commercial Support

For private advice, support, reviews, access to the maintainer, and the like, reach out for commercial support.

Requirements

On Linux:

  • OpenSSL with headers. See https://docs.rs/openssl for supported versions and more details. Alternatively you can enable the native-tls-vendored feature to compile a copy of OpenSSL. Or, you can use rustls via rustls-tls or other rustls-tls-* features.

On Windows and macOS:

  • Nothing.

By default, Reqwest uses rust-native-tls, which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use the available OpenSSL or fail to build if not found.

License

Licensed under either of

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 dual licensed as above, without any additional terms or conditions.

Sponsors

Support this project by becoming a sponsor.

最近版本更新:(数据更新于 2024-10-05 10:46:23)

2024-10-01 02:14:22 v0.12.8

2024-08-20 05:05:02 v0.12.7

2024-08-20 00:01:18 v0.12.6

2024-06-17 23:17:01 v0.12.5

2024-04-20 01:39:44 v0.12.4

2024-04-05 22:30:23 v0.12.3

2024-03-25 22:19:35 v0.12.2

2024-03-22 22:01:45 v0.12.1

2024-03-20 23:54:28 v0.12.0

2024-03-20 02:29:14 v0.11.27

主题(topics):

http, http-client, rust

seanmonstar/reqwest同语言 Rust最近更新仓库

2024-12-22 08:48:41 lapce/lapce

2024-12-19 20:41:09 tw93/Pake

2024-12-19 19:31:32 dashpay/platform

2024-12-18 10:31:25 DioxusLabs/dioxus

2024-12-17 17:18:34 lanyeeee/jmcomic-downloader

2024-12-16 23:19:51 meilisearch/meilisearch