MyGit

seanmonstar/reqwest

Fork: 1128 Star: 9937 (更新于 2024-11-20 08:06:53)

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.

On Windows and macOS:

  • Nothing.

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-11-20 07:29:29 lanyeeee/jmcomic-downloader

2024-11-19 23:39:15 gleam-lang/gleam

2024-11-19 08:50:55 lapce/lapce

2024-11-11 22:51:00 tauri-apps/tauri

2024-11-11 07:55:30 dani-garcia/vaultwarden

2024-11-09 16:42:37 rustdesk/rustdesk