1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-12-18 09:53:11 +01:00
actix-web/awc/README.md

38 lines
1.4 KiB
Markdown
Raw Normal View History

2020-10-30 03:50:53 +01:00
# awc (Actix Web Client)
2019-04-16 19:49:38 +02:00
2020-10-30 03:50:53 +01:00
> Async HTTP and WebSocket client library.
2019-04-16 19:49:38 +02:00
2020-10-30 03:50:53 +01:00
[![crates.io](https://img.shields.io/crates/v/awc?label=latest)](https://crates.io/crates/awc)
2021-02-10 13:10:03 +01:00
[![Documentation](https://docs.rs/awc/badge.svg?version=3.0.0-beta.2)](https://docs.rs/awc/3.0.0-beta.2)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/awc)
[![Dependency Status](https://deps.rs/crate/awc/3.0.0-beta.2/status.svg)](https://deps.rs/crate/awc/3.0.0-beta.2)
2020-10-30 03:50:53 +01:00
[![Join the chat at https://gitter.im/actix/actix-web](https://badges.gitter.im/actix/actix-web.svg)](https://gitter.im/actix/actix-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2019-04-16 19:49:38 +02:00
2020-10-30 03:50:53 +01:00
## Documentation & Resources
2020-11-25 01:07:56 +01:00
- [API Documentation](https://docs.rs/awc)
- [Example Project](https://github.com/actix/examples/tree/HEAD/security/awc_https)
2020-10-30 03:50:53 +01:00
- [Chat on Gitter](https://gitter.im/actix/actix-web)
2020-12-28 01:44:15 +01:00
- Minimum Supported Rust Version (MSRV): 1.46.0
2019-04-16 19:49:38 +02:00
## Example
2019-04-16 19:49:38 +02:00
```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
.header("User-Agent", "Actix-web")
.send() // <- Send http request
.await;
println!("Response: {:?}", res); // <- server http response
});
2019-04-16 19:49:38 +02:00
}
```