Expand description
Query string parsing utilities.
Provides parse for deserializing URL query strings into key-value maps.
Used internally by query predicates and extractors.
§Supported Syntax
- Simple parameters:
key=value - Multiple parameters:
key1=value1&key2=value2 - Array syntax:
color[]=red&color[]=blue - Nested parameters:
filter[status]=active(up to 5 levels deep)
§Security
Nesting depth is limited to 5 levels to prevent DoS attacks via deeply nested queries that could cause stack overflow or memory exhaustion.
§Examples
use hitbox_http::query::{parse, Value};
let params = parse("page=1&limit=10").unwrap();
assert_eq!(params.get("page").unwrap().inner(), vec!["1"]);
// Array parameters
let params = parse("color[]=red&color[]=blue").unwrap();
assert_eq!(params.get("color").unwrap().inner(), vec!["red", "blue"]);Enums§
- Value
- A query parameter value, either a single string or an array of strings.
Functions§
- parse
- Parses a query string into a map of key-value pairs.