Skip to main content

percent_encode

Function percent_encode 

Source
pub fn percent_encode(text: &str) -> String
Expand description

Percent-encode a path, leaving the segment separator alone.

This is what Python’s urllib.parse.quote does with its default safe="/", so an identifier appears in a Location header the same way in every implementation.

§Examples

use lino_rest_api::request::percent_encode;

assert_eq!(percent_encode("a b/c"), "a%20b/c");