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

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 PushPromise.

Parameters

  • headerName string
  • The header name

  • headerValue string
  • The header value

setHeader

Sets the value of a transport header in PushPromise.

Parameters

  • headerName string
  • The header name

  • headerValue string
  • The header value

removeHeader

Removes a transport header from the PushPromise.

Parameters

  • headerName string
  • The header name

removeAllHeaders

Removes all transport headers from the PushPromise.

getHeaderNames

()

returns string

Gets all transport header names from the PushPromise.

  • Return Type

    (string)
  • An array of all transport header names