Skip to main content

parse_query_string

Function parse_query_string 

Source
pub fn parse_query_string(query: &str) -> Map<String, Value>
Expand description

Parse a URL query string (or application/x-www-form-urlencoded body) into a serde_json::Map.

  • keys and values are form-decoded (url_decode) and values coerced via coerce_value;
  • a key without = (?flag) yields "", like URLSearchParams;
  • a repeated key (a=1&a=2) yields an array [1, 2];
  • a key ending in [] (a[]=1) always yields an array under a.