Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Field

A name-value pair representing a single field transmitted in an HTTP Request or Response. The kind will dictate metadata placement within an HTTP message. All field names are case insensitive and case-variance must be treated as equivalent. Names MAY be normalized but SHOULD be preserved for accuracy during transmission.

Hierarchy

  • Field

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Field(__namedParameters: { kind: undefined | HEADER | TRAILER; name: string; values: undefined | string[] }): Field
  • Parameters

    • __namedParameters: { kind: undefined | HEADER | TRAILER; name: string; values: undefined | string[] }
      • kind: undefined | HEADER | TRAILER
      • name: string
      • values: undefined | string[]

    Returns Field

Properties

Readonly kind

Readonly name

name: string

values

values: string[]

Methods

add

  • add(value: string): void
  • Appends a value to the field.

    Parameters

    • value: string

      The value to append.

    Returns void

get

  • get(): string[]
  • Get string values as a list

    Returns string[]

    Values in Field as a list.

remove

  • remove(value: string): void
  • Remove all matching entries from list.

    Parameters

    • value: string

      Value to remove.

    Returns void

set

  • set(values: string[]): void
  • Overwrite existing field values.

    Parameters

    • values: string[]

      The new field values.

    Returns void

toString

  • toString(): string
  • Get comma-delimited string to be sent over the wire.

    Returns string

    String representation of Field.