Merge pull request #105 from actix/master

-
This commit is contained in:
云上于天 2020-11-05 09:39:06 +08:00 committed by GitHub
commit c227fa9654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 16 deletions

View File

@ -1,8 +1,15 @@
blank_issues_enabled: true blank_issues_enabled: true
contact_links: contact_links:
- name: Gitter channel (actix-web) - name: GitHub Discussions
url: https://github.com/actix/actix-web/discussions
about: Actix Web Q&A
- name: Gitter chat (actix-web)
url: https://gitter.im/actix/actix-web url: https://gitter.im/actix/actix-web
about: Please ask and answer questions about the actix-web here. about: Actix Web Q&A
- name: Gitter channel (actix) - name: Gitter chat (actix)
url: https://gitter.im/actix/actix url: https://gitter.im/actix/actix
about: Please ask and answer questions about the actix here. about: Actix (actor framework) Q&A
- name: Actix Discord
url: https://discord.gg/NWpN5mmg3x
about: Actix developer discussion and community chat

View File

@ -16,23 +16,21 @@
- Minimum Supported Rust Version (MSRV): 1.42.0 - Minimum Supported Rust Version (MSRV): 1.42.0
## Example ## Example
```rust ```rust
use actix_rt::System; use actix_rt::System;
use awc::Client; use awc::Client;
use futures::future::{Future, lazy};
fn main() { fn main() {
System::new("test").block_on(lazy(|| { System::new("test").block_on(async {
let mut client = Client::default(); let client = Client::default();
client.get("http://www.rust-lang.org") // <- Create request builder let res = client
.header("User-Agent", "Actix-web") .get("http://www.rust-lang.org") // <- Create request builder
.send() // <- Send http request .header("User-Agent", "Actix-web")
.and_then(|response| { // <- server http response .send() // <- Send http request
println!("Response: {:?}", response); .await;
Ok(())
}) println!("Response: {:?}", res); // <- server http response
})); });
} }
``` ```