Expand description
HTTP client.
use ntex::client::Client;
#[ntex::main]
async fn main() {
let client = Client::new();
let response = client
.get("https://www.rust-lang.org")
.header("User-Agent", "ntex")
.send()
.await;
println!("Response: {response:?}");
}Modules§
- error
- HTTP client errors.
Structs§
- Client
- An HTTP client.
- Client
Builder - An HTTP client builder.
- Client
Config - Runtime configuration for an HTTP
Client. - Client
Request - An HTTP client request builder.
- Client
Response - An HTTP client response.
- Json
Body - Future that buffers and deserializes a JSON response body.
- Message
Body - Future that buffers a complete HTTP response body.
- Service
Request - HTTP request passed through client middleware before it is sent.
- Service
Response - HTTP response passed through client middleware.
- Test
Response - Builder for creating a
ClientResponsein tests.