Object - http : PushPromise

Represents an HTTP/2 PUSH_PROMISE frame.

Constructor

__init

(string path, string method)

  • path string /
  • The resource path

  • method string GET
  • The HTTP method

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 Phttp:ushPromise.

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

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

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[]

Gets transport headers from the PushPromise.

Parameters

  • headerName string
  • The header name

  • Return Type

    (string[])
  • The array of header values

addHeader

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

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

Parameters

  • headerName string
  • The header name

  • headerValue string
  • The header value

removeHeader

Removes a transport header from the http:PushPromise.

Parameters

  • headerName string
  • The header name

removeAllHeaders

Removes all transport headers from the Phttp:ushPromise.

getHeaderNames

()

returns string[]

Gets all transport header names from the http:PushPromise.

  • Return Type

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