mirror of
https://github.com/fafhrd91/actix-web
synced 2025-02-22 20:13:17 +01:00
* prepare actix-router release 0.5.0-beta.2 * prepare actix-web-codegen release 0.5.0-beta.4 * prepare actix-http release 3.0.0-beta.10 * prepare awc release 3.0.0-beta.8 * prepare actix-web release 4.0.0-beta.9 * prepare actix-http-test release 3.0.0-beta.6 * prepare actix-test release 0.1.0-beta.4 * prepare actix-files release 0.6.0-beta.7 * prepare actix-multipart release 0.4.0-beta.6 * prepare actix-web-actors release 4.0.0-beta.7 * fix http test version * re-add patch * update router repo url * fix http test readme version
37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
# awc (Actix Web Client)
|
|
|
|
> Async HTTP and WebSocket client library.
|
|
|
|
[](https://crates.io/crates/awc)
|
|
[](https://docs.rs/awc/3.0.0-beta.8)
|
|

|
|
[](https://deps.rs/crate/awc/3.0.0-beta.8)
|
|
[](https://discord.gg/NWpN5mmg3x)
|
|
|
|
## Documentation & Resources
|
|
|
|
- [API Documentation](https://docs.rs/awc)
|
|
- [Example Project](https://github.com/actix/examples/tree/HEAD/security/awc_https)
|
|
- Minimum Supported Rust Version (MSRV): 1.51.0
|
|
|
|
## Example
|
|
|
|
```rust
|
|
use actix_rt::System;
|
|
use awc::Client;
|
|
|
|
fn main() {
|
|
System::new().block_on(async {
|
|
let client = Client::default();
|
|
|
|
let res = client
|
|
.get("http://www.rust-lang.org") // <- Create request builder
|
|
.insert_header(("User-Agent", "Actix-web"))
|
|
.send() // <- Send http request
|
|
.await;
|
|
|
|
println!("Response: {:?}", res); // <- server http response
|
|
});
|
|
}
|
|
```
|