mirror of https://github.com/fafhrd91/actix-web
It's Rust convention for method names to be in snake case, so much so that the compiler emits a warning by default for non-snake-case methods. Reading something like `HttpResponse::Ok()` leads me to believe that I'm creating an instance of the `Ok` variant of a `HttpResponse` enum, but for some reason there's no associated data (which _is_ possible, there's just no reason to define an enum that way). There are other cases of #[allow(non_snake_case)] in the actix codebase, but this commit only addresses the `HttpResponse::XXX()` methods. |
||
---|---|---|
.. | ||
src | ||
tests | ||
CHANGES.md | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
README.md
awc (Actix Web Client)
Async HTTP and WebSocket client library.
Documentation & Resources
- API Documentation
- Example Project
- Chat on Gitter
- Minimum Supported Rust Version (MSRV): 1.46.0
Example
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
});
}