#[request_headers]
Expand description
Extracts all HTTP request headers into a collection variable.
This attribute macro retrieves all available HTTP request headers from the request and makes them available as a collection for comprehensive request header access.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[request_headers(all_request_headers)]
async fn handle_with_all_request_headers(ctx: Context) {
for (name, value) in all_request_headers {
// Process each request_header
}
}
The macro accepts a variable name that will contain all HTTP request headers. The variable will be available as a collection in the function scope.