Table of Contents

Class ProvideResponseCommandParameters

Namespace
WebDriverBiDi.Network
Assembly
WebDriverBiDi.dll

Provides parameters for the network.provideResponse command.

public class ProvideResponseCommandParameters : CommandParameters<ProvideResponseCommandResult>
Inheritance
ProvideResponseCommandParameters
Inherited Members

Constructors

ProvideResponseCommandParameters(string)

Initializes a new instance of the ProvideResponseCommandParameters class.

public ProvideResponseCommandParameters(string requestId)

Parameters

requestId string

The ID of the request to continue.

Properties

Body

Gets or sets the body of the response.

[JsonPropertyName("body")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public BytesValue? Body { get; set; }

Property Value

BytesValue

Cookies

Gets or sets the cookies of the response.

[JsonPropertyName("cookies")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<SetCookieHeader>? Cookies { get; set; }

Property Value

List<SetCookieHeader>

Remarks

This is one of the few list properties on a CommandParameters type that is nullable and settable, because the protocol gives a present-but-empty array its own meaning. In the remote end steps for network.provideResponse, when the command contains "cookies" one Set-Cookie header is appended per supplied cookie to a header list that depends on whether the command also contains "headers": when it does not, the response's existing header list is rebuilt without its Set-Cookie headers first, so sending [] alone replaces the response cookies with none; when it does, the supplied Headers are kept as sent, including any Set-Cookie entries among them, and the cookies are appended to them. Omitting the field keeps the original cookies.

When null, the property is not included in the command; when an empty list, an empty array is sent to the remote end. Every other list property is read-only and is omitted while empty.

Headers

Gets or sets the headers of the response.

[JsonPropertyName("headers")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Header>? Headers { get; set; }

Property Value

List<Header>

Remarks

This is one of the few list properties on a CommandParameters type that is nullable and settable, because the protocol gives a present-but-empty array its own meaning. When network.provideResponse is given a headers field, the remote end builds the response's header list from that field alone. Sending [] therefore produces a response with no headers, while omitting the field lets the remote end supply its own.

When null, the property is not included in the command; when an empty list, an empty array is sent to the remote end. Every other list property is read-only and is omitted while empty.

MethodName

Gets the method name of the command.

[JsonIgnore]
public override string MethodName { get; }

Property Value

string

ReasonPhrase

Gets or sets the HTTP reason phrase ('OK', 'Not Found', etc.) of the response.

[JsonPropertyName("reasonPhrase")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ReasonPhrase { get; set; }

Property Value

string

RequestId

Gets or sets the ID of the request to continue.

[JsonPropertyName("request")]
public string RequestId { get; set; }

Property Value

string

StatusCode

Gets or sets the HTTP status code of the response.

[JsonPropertyName("statusCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ulong? StatusCode { get; set; }

Property Value

ulong?