Class: PushPromise

Represents an HTTP/2 PUSH_PROMISE frame.

Constructor

Constructs an http:PushPromise from a given path and a method.

init (string path, string method)
  • path string "/"
  • The resource path

  • method string "GET"
  • The HTTP method

Methods

hasHeader

Checks whether the requested header exists.

getHeader

Returns the header value with the specified header name.

getHeaders

Gets transport headers from the PushPromise.

addHeader

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

setHeader

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

removeHeader

Removes a transport header from the http:PushPromise.

removeAllHeaders

Removes all transport headers from the http:PushPromise.

getHeaderNames

Gets all transport header names from the http:PushPromise.

Fields

hasHeader

function 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

function 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 () if there is no such header

getHeaders

function 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

function 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

function 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

function removeHeader(string headerName)
Isolated Function

Removes a transport header from the http:PushPromise.

Parameters

  • headerName string
  • The header name

removeAllHeaders

function removeAllHeaders()
Isolated Function

Removes all transport headers from the http:PushPromise.

getHeaderNames

function getHeaderNames() returns string[ ]
Isolated Function

Gets all transport header names from the http:PushPromise.

Return Type

(string[ ])

An array of all transport header names