Expand description
§actix-web-middleware-requestid
Request ID middleware for the actix-web framework v3.0+. Adds a custom header with a unique token to every request.
§Usage
Add the package to Cargo.toml:
[dependencies]
actix-web-middleware-requestid = "3.0"
Import and add middleware to your server definition:
use actix_web_middleware_requestid::RequestID;
...
App::new()
...
.wrap(RequestID)
For actix-web v1.x use version “1.0” of the same package. The usage pattern and all exported names remain the same.
§For actix-web < 1.0
Consider using a similar crate actix-web-requestid
Structs§
- RequestID
- Request ID extractor
- RequestID
Middleware - Actual actix-web middleware
- RequestID
Wrapper - Request ID wrapper.
Constants§
- REQUEST_
ID_ HEADER - The header set by the middleware