uce/site/doc/pages/0_StringMap.txt
2026-06-16 12:21:31 +00:00

35 lines
667 B
Plaintext

:sig
0_StringMap
:see
>types
0_Request
parse_query
encode_query
array_merge
:content
Associative container mapping `String` keys to `String` values.
`StringMap` is an alias for `std::map<String, String>`.
## Common Uses
`StringMap` commonly appears in:
- `context.params`
- `context.get`
- `context.post`
- `context.cookies`
- `context.session`
- `context.header`
Because it uses `std::map`, `map["key"]` will create an empty entry when that key does not already exist.
Helpers such as `parse_query()` and `encode_query()` convert between query strings and `StringMap` values.
:example
StringMap params;
params["page"] = "docs";
print(params["page"], "\n");