Lyricdev
GitHub

class Headers

pub class Headers

The header fields of a message, in the order written; names compare without case.

Methods

pub static fn new(): Headers
pub fn get(name: string): ?string

Returns the first value of the field, null where there is none.

pub fn all(name: string): string[]

Returns every value of the field, in order.

pub fn has(name: string): bool
pub mut fn set(name: string, value: string): void

Sets the field to this value alone, removing its other values.

pub mut fn add(name: string, value: string): void

Adds one more value of the field.

pub mut fn remove(name: string): void
pub fn length(): int
pub fn pairs(): List<(string, string)>