mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 23:51:06 +01:00
64f603b076
* Support to set header names of `ClientRequest` as Camel-Case This is the case for supporting to request for servers which don't perfectly implement the `RFC 7230`. It is important for an app which uses `ClientRequest` as core part. * Add field `upper_camel_case_headers` to `ClientRequest`. * Add function `set_upper_camel_case_headers` to `ClientRequest` and `ClientRequestBuilder` to set field `upper_camel_case_headers`. * Add trait `client::writer::UpperCamelCaseHeader` for `http::header::HeaderName`, let it can be converted to Camel-Case then writed to buffer. * Add test `test_client::test_upper_camel_case_headers`. * Support upper Camel-Case headers * [actix-http] Add field `upper_camel_case_headers` for `RequestHead` * [actix-http] Add code for `MessageType` to support upper camel case * [awc] Add functions for `ClientRequest` to set upper camel case * Use `Flags::CAMEL_CASE` for upper camel case of headers |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
CHANGES.md | ||
README.md |
Actix http client
An HTTP Client
Documentation & community resources
- User Guide
- API Documentation
- Chat on gitter
- Cargo package: awc
- Minimum supported Rust version: 1.33 or later
Example
use actix_rt::System;
use awc::Client;
use futures::future::{Future, lazy};
fn main() {
System::new("test").block_on(lazy(|| {
let mut client = Client::default();
client.get("http://www.rust-lang.org") // <- Create request builder
.header("User-Agent", "Actix-web")
.send() // <- Send http request
.and_then(|response| { // <- server http response
println!("Response: {:?}", response);
Ok(())
})
}));
}