Expand description
Apply content encodings (such as gzip compression) to the response.
This module provides access to the content encodings supported by a request as well as a function to automatically apply common content encodings to a response.
§Basic example
Here is a basic example showing how to use content encodings:
use rouille::Request;
use rouille::Response;
use rouille::content_encoding;
fn handle_request(request: &Request) -> Response {
let response = Response::text("Hello world");
content_encoding::apply(&request, response)
}
Functions§
- Applies content encoding to the response.