Function serde_urlencoded::to_string [] [src]

pub fn to_string<T: Serialize>(input: &T) -> Result<String, Error>

Serializes a value into a application/x-wwww-url-encoded String buffer.

let meal = &[
    ("bread", "baguette"),
    ("cheese", "comté"),
    ("meat", "ham"),
    ("fat", "butter"),
];

assert_eq!(
    serde_urlencoded::to_string(meal),
    Ok("bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter".to_owned()));