Skip to content
FutureBlitz

    Install

    Import std.net.http.headers

    std.net.http.headers

    Headers, an HTTP request's or response's header fields: names, which ASCII's letter cases don't change, as "Content-Type" and "content-type" are one, each with its values, in the order they were added.

    std/net/http/headers.fb

    Types

    Headers class

    Public Class Headers Implements Iterable<(String, String)>, Cloneable, Printable

    A request's or a response's header fields, as names and values. A name keeps the letter cases it was given, and finds every value of it in any.

    std/net/http/headers.fb, line 16

    • Public Property Count: Int property #

      How many fields it has: each name and value.

    • @PanicsAtCaller Public Method Add(name: String, value: String) method #

      Adds a value for name, after any it has. Panics when name isn't a header's name, a token of letters, digits, and !#$%&'*+-.^_|~, or value` has a control character other than a tab, as a line break would make it another header.

    • @PanicsAtCaller Public Method Set(name: String, value: String) method #

      Gives name only value, where its first one was, or last when it had none. Panics as Add does.

    • Public Method Get(name: String): String? method #

      name's first value, or Null when it has none.

    • Public Method GetAll(name: String): String[] method #

      Each of name's values, in order.

    • Public Method Contains(name: String): Bool method #

      Whether it has a value of name, whatever its letters' case.

    • Public Method Remove(name: String): Bool method #

      Takes out each of name's values, and tells whether it had any.

    • Public Method Clear() method #

      Takes every header out.

    • Public Method Iterate(): HeadersIterator method #

      Each name and value, in order.

    • Public Method Clone(): Headers method #

      New Headers with the same names and values.

    • Public Method ToString(): String method #

      Each as "Name: value", or "Name:" for an empty value, a line each.

    HeadersIterator struct

    Public Struct HeadersIterator Implements Iterator<(String, String)>

    Headers' names and values, in order, as far as their Count when each is read.

    std/net/http/headers.fb, line 139

    Report an issue with this page or with FutureBlitz on GitHub.