mirror of
https://github.com/fafhrd91/actix-web
synced 2025-02-20 11:20:32 +01:00
37 lines
1.3 KiB
Markdown
37 lines
1.3 KiB
Markdown
# awc (Actix Web Client)
|
|
|
|
> Async HTTP and WebSocket client library.
|
|
|
|
[](https://crates.io/crates/awc)
|
|
[](https://docs.rs/awc/2.0.3)
|
|

|
|
[](https://deps.rs/crate/awc/2.0.3)
|
|
[](https://gitter.im/actix/actix-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
|
|
## Documentation & Resources
|
|
|
|
- [API Documentation](https://docs.rs/awc)
|
|
- [Example Project](https://github.com/actix/examples/tree/HEAD/awc_https)
|
|
- [Chat on Gitter](https://gitter.im/actix/actix-web)
|
|
- Minimum Supported Rust Version (MSRV): 1.46.0
|
|
|
|
## Example
|
|
```rust
|
|
use actix_rt::System;
|
|
use awc::Client;
|
|
|
|
fn main() {
|
|
System::new("test").block_on(async {
|
|
let client = Client::default();
|
|
|
|
let res = client
|
|
.get("http://www.rust-lang.org") // <- Create request builder
|
|
.header("User-Agent", "Actix-web")
|
|
.send() // <- Send http request
|
|
.await;
|
|
|
|
println!("Response: {:?}", res); // <- server http response
|
|
});
|
|
}
|
|
```
|