Module request
Expand description
Remove headers from a request.
§Example
use rama_http::layer::remove_header::RemoveRequestHeaderLayer;
use rama_http::{Body, Request, Response, header::{self, HeaderValue}};
use rama_core::service::service_fn;
use rama_core::{Context, Service, Layer};
use rama_core::error::BoxError;
let mut svc = (
// Layer that removes all request headers with the prefix `x-foo`.`ac
RemoveRequestHeaderLayer::prefix("x-foo"),
).layer(http_client);
let request = Request::new(Body::empty());
let response = svc.serve(Context::default(), request).await?;
Structs§
- Middleware that removes headers from a request.
- Layer that applies
RemoveRequestHeader
which removes request headers.