Module hyper
Low-level HTTP/1 and HTTP/2 implementation for the tokio ecosystem.
hyper is the HTTP implementation underlying axum, reqwest,
and other Rust HTTP libraries.
Most applications should use those higher-level crates;
use hyper directly when you need fine-grained control over HTTP connections
or are building your own HTTP framework.
Core types (re-exported from the http crate):
Request/Response- HTTP request and response, generic over body typeMethod- HTTP methods (GET, POST, etc.)StatusCode- HTTP status codes (200, 404, etc.)Uri- request URIsHeaderMap- HTTP header collection
Examples
Working with HTTP request and response types:
use ;
let req = builder
.method
.uri
.header
.body
.unwrap;
assert_eq!;
assert_eq!;
let resp = builder
.status
.header
.body
.unwrap;
assert_eq!;