Headers¶
A collection of HTTP headers with case-insensitive name lookup.
Names are lowercased on storage. Use set() to replace all values for a
name, or add() to append an additional value (appropriate for multi-value
headers like Set-Cookie).
Constructors¶
create¶
Create an empty header collection.
Returns¶
- Headers ref^
Public Functions¶
set¶
Set a header, removing any existing entries with the same name.
After this call, get(name) returns value and there is exactly one
entry for this name.
Parameters¶
Returns¶
- None val
add¶
Add a header entry without removing existing entries with the same name.
This is appropriate for headers that can appear multiple times
(e.g., Set-Cookie). Use set() when you want to replace.
Parameters¶
Returns¶
- None val
get¶
Get the first value for the given header name (case-insensitive).
Returns None if no header with that name exists.
Parameters¶
- name: String val
Returns¶
size¶
Return the number of header entries.
Returns¶
- USize val
values¶
Iterate over all header entries as (name, value) pairs.
fun box values()
: ArrayValues[(String val , String val), this->Array[(String val , String val)] ref] ref