ProvideResponseParameters

Represents parameters for providingResponse command. Described in https://w3c.github.io/webdriver-bidi/#command-network-provideResponse.

Constructor

new ProvideResponseParameters()

Methods

body(value) → {ProvideResponseParameters}

Sets the body value for the response parameters.

Parameters:
NameTypeDescription
valueBytesValue

The value to set as the body. Must be an instance of BytesValue.

Throws:
  • Throws an error if the value is not an instance of BytesValue.
Type
Error
Returns:
  • Returns the ProvideResponseParameters object for chaining.
Type: 
ProvideResponseParameters

cookies(cookieHeaders) → {ProvideResponseParameters}

Sets the cookie headers for the response.

Parameters:
NameTypeDescription
cookieHeadersArray.<Header>

An array of cookie headers.

Throws:
  • Throws an error if a cookie header is not an instance of Header.
Type
Error
Returns:
  • Returns the ProvideResponseParameters object for chaining.
Type: 
ProvideResponseParameters

headers(headers) → {ProvideResponseParameters}

Sets the headers for the response.

Parameters:
NameTypeDescription
headersArray.<Header>

The headers to be set.

Throws:
  • If the provided header is not an instance of Header.
Type
Error
Returns:
  • Returns the ProvideResponseParameters object for chaining.
Type: 
ProvideResponseParameters

reasonPhrase(reasonPhrase) → {ProvideResponseParameters}

Sets the reason phrase for the response.

Parameters:
NameTypeDescription
reasonPhrasestring

The reason phrase to set.

Throws:
  • If the reason phrase is not a string.
Type
Error
Returns:
  • Returns the ProvideResponseParameters object for chaining.
Type: 
ProvideResponseParameters

statusCode(statusCode) → {ProvideResponseParameters}

Sets the status code for the response.

Parameters:
NameTypeDescription
statusCodenumber

The status code to set.

Throws:
  • If the status code is not an integer.
Type
Error
Returns:
  • Returns the ProvideResponseParameters object for chaining.
Type: 
ProvideResponseParameters