Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Headers

Route handler parameter decorator. Extracts the headers property from the req object and populates the decorated parameter with the value of headers.

For example: async update(@Headers('Cache-Control') cacheControl: string)

param

name of single header property to extract.

see

Request object

publicapi

Hierarchy

  • Headers

Index

Constructors

constructor

  • Headers class

    Returns Headers

    Void

Methods

[Symbol.iterator]

  • [Symbol.iterator](): any
  • Get an iterator on entries.

    This is the default iterator of the Headers object.

    Returns any

    Iterator

append

  • append(name: any, value: any): void
  • Append a value onto existing header

    Parameters

    • name: any
    • value: any

    Returns void

    Void

delete

  • delete(name: any): void
  • Delete all header values given name

    Parameters

    • name: any

    Returns void

    Void

forEach

  • forEach(callback: any): void
  • Iterate over all headers

    Parameters

    • callback: any

    Returns void

    Void

get

  • get(name: any): any
  • Return combined header value given name

    Parameters

    • name: any

    Returns any

    Mixed

has

  • has(name: any): boolean
  • Check for header name existence

    Parameters

    • name: any

    Returns boolean

    Boolean

keys

  • keys(): any
  • Get an iterator on keys.

    Returns any

    Iterator

raw

  • raw(): any
  • Return raw headers (non-spec api)

    Returns any

    Object

set

  • set(name: any, value: any): void
  • Overwrite header values given name

    Parameters

    • name: any
    • value: any

    Returns void

    Void

values

  • values(): any
  • Get an iterator on values.

    Returns any

    Iterator

Generated using TypeDoc