A flexible and ergonomic HTTP toolkit for Rust that provides high-level abstractions for HTTP operations while maintaining performance and type safety.
- Type-safe HTTP primitives - Request, Response, Headers, and Body types with strong type checking
- Streaming support - Efficient handling of large payloads through streaming interfaces
- Body transformations - Convert between different body formats (JSON, form data, files) with zero-copy when possible
- Middleware system - Extensible middleware architecture for request/response processing
- Async/await ready - Built on top of
futures-litefor async I/O operations
json- JSON serialization/deserialization via serde_jsonform- Form data handling via serde_urlencodedfs- File upload support with MIME type detectionmime- MIME type parsing and manipulationhttp_body- Implementation of http_body traits
use http_kit::{Request, Response, Result};
async fn handler(mut req: Request) -> Result<Response> {
// Parse JSON request body
let user = req.into_json().await?;
// Create JSON response
Response::empty()
.status(200)
.json(&user)
}This project is licensed under the MIT license.