Form extraction — `request.form()`
request.form() is a method built into Request that orchestrates a full pipeline behind the scenes:
request.form() is a method built into Request that orchestrates a full pipeline behind the scenes:
- Sentinel — Verifies access rules (login, roles) via
GuardRules. - Aegis — Single body extraction (multipart, urlencoded, json) normalized into a
HashMap. - CSRF Gate — Verifies the CSRF token in parsed data.
- Construction — Builds the form
T, fills fields, and runs validation.
use runique::prelude::*;
pub async fn register(mut request: Request) -> AppResult<Response> {
let mut form: RegisterForm = request.form();
if request.is_post() {
if form.is_valid().await {
// Valid form → processing
}
}
// ...
}
💡 The developer simply calls
request.form()— the entire security pipeline is transparent.
← Forms | RuniqueForm trait →