mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-15 00:00:20 +02:00
Previously extractors worked directly on `Request<B>` which meant you had to do weird tricks like `mem::take(req.headers_mut())` to get owned parts of the request. This changes that instead to use a new `RequestParts` type that have methods to "take" each part of the request. Without having to do weird tricks. Also removed the need to have `B: Default` for body extractors.
Examples
hello_world- Very small getting started app.key_value_store- Slightly larger app with an in-memory key/value store.form- Receiving data from an HTML<form>.static_file_server- Serving static files from a directory. Could for example be the baseline for a single page app.templates- Rending HTML templates using askama.testing- How to test axum apps.versioning- How one might version an API.websocket- How to build an app that handles WebSocket connections.error_handling_and_dependency_injection- How to handle errors and dependency injection using trait objects.tokio_postgres- How to use a tokio-postgres and bb8 to query a database.