Skip to main content

RequestHandler

Trait RequestHandler 

Source
pub trait RequestHandler: Send + Sync {
    // Required methods
    fn handle_request(&self, req: &mut Request<BoxBody>);
    fn handle_response(&self, res: &mut Response<BoxBody>);
}
Expand description

Trait for intercepting and modifying HTTP requests and responses.

Required Methods§

Source

fn handle_request(&self, req: &mut Request<BoxBody>)

Called before forwarding the request to upstream. Modify the request in place to alter what gets sent.

Source

fn handle_response(&self, res: &mut Response<BoxBody>)

Called before sending the response back to the client. Modify the response in place to alter what the client receives.

Implementors§