Class - http : PushPromise

Represents an HTTP/2 PUSH_PROMISE frame.

Methods

Checks whether the requested header exists.

Returns the header value with the specified header name.

Gets transport headers from the PushPromise.

Adds the specified key/value pair as an HTTP header to the http:PushPromise.

Sets the value of a transport header in the http:PushPromise.

Removes a transport header from the http:PushPromise.

Removes all transport headers from the http:PushPromise.

Gets all transport header names from the http:PushPromise.

Fields

  • path string
  • The resource path

  • method string
  • The HTTP method

hasHeader

(string headerName)

returns boolean
Isolated Function

Checks whether the requested header exists.

Parameters

  • headerName string
  • The header name

  • Return Type

    (boolean)
  • A boolean representing the existence of a given header

getHeader

(string headerName)

returns string
Isolated Function

Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.

Parameters

  • headerName string
  • The header name

  • Return Type

    (string)
  • The header value, or null if there is no such header

getHeaders

(string headerName)

returns string[]
Isolated Function

Gets transport headers from the PushPromise.

Parameters

  • headerName string
  • The header name

  • Return Type

    (string[])
  • The array of header values

addHeader

(string headerName, string headerValue)

Isolated Function

Adds the specified key/value pair as an HTTP header to the http:PushPromise.

Parameters

  • headerName string
  • The header name

  • headerValue string
  • The header value

setHeader

(string headerName, string headerValue)

Isolated Function

Sets the value of a transport header in the http:PushPromise.

Parameters

  • headerName string
  • The header name

  • headerValue string
  • The header value

removeHeader

(string headerName)

Isolated Function

Removes a transport header from the http:PushPromise.

Parameters

  • headerName string
  • The header name

removeAllHeaders

()

Isolated Function

Removes all transport headers from the http:PushPromise.

getHeaderNames

()

returns string[]
Isolated Function

Gets all transport header names from the http:PushPromise.

  • Return Type

    (string[])
  • An array of all transport header names