Table of Contents

Class BidiHttpRequest

Namespace
PuppeteerSharp.Bidi
Assembly
PuppeteerSharp.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class BidiHttpRequest : Request<BidiHttpResponse>, IRequest
Inheritance
BidiHttpRequest
Implements

Properties

Headers

Gets the merged headers including extra HTTP headers and user agent headers.

public override Dictionary<string, string> Headers { get; }

Property Value

Dictionary<string, string>

Methods

AbortAsync(RequestAbortErrorCode, int?)

Aborts request. To use this, request interception should be enabled with SetRequestInterceptionAsync(bool). Exception is immediately thrown if the request interception is not enabled.

public override Task AbortAsync(RequestAbortErrorCode errorCode = RequestAbortErrorCode.Failed, int? priority = null)

Parameters

errorCode RequestAbortErrorCode

Optional error code. Defaults to Failed.

priority int?

Optional intercept abort priority. If provided, intercept will be resolved using cooperative handling rules. Otherwise, intercept will be resolved immediately. IMPORTANT: If you set the priority, you will need to attach Request listener using AddRequestInterceptor(Func<IRequest, Task>) instead of Request.

Returns

Task

Task.

ContinueAsync(Payload, int?)

Continues request with optional request overrides. To use this, request interception should be enabled with SetRequestInterceptionAsync(bool). Exception is immediately thrown if the request interception is not enabled. If the URL is set it won't perform a redirect. The request will be silently forwarded to the new url. For example, the address bar will show the original url.

public override Task ContinueAsync(Payload payloadOverrides = null, int? priority = null)

Parameters

payloadOverrides Payload

Optional request overwrites.

priority int?

Optional intercept abort priority. If provided, intercept will be resolved using cooperative handling rules. Otherwise, intercept will be resolved immediately. IMPORTANT: If you set the priority, you will need to attach Request listener using AddRequestInterceptor(Func<IRequest, Task>) instead of Request.

Returns

Task

Task.

FetchPostDataAsync()

Fetches the POST data for the request from the browser.

public override Task<string> FetchPostDataAsync()

Returns

Task<string>

Task which resolves to the request's POST data.

RespondAsync(ResponseData, int?)

Fulfills request with given response. To use this, request interception should be enabled with SetRequestInterceptionAsync(bool). Exception is thrown if request interception is not enabled.

public override Task RespondAsync(ResponseData response, int? priority = null)

Parameters

response ResponseData

Response that will fulfill this request.

priority int?

Optional intercept abort priority. If provided, intercept will be resolved using cooperative handling rules. Otherwise, intercept will be resolved immediately. IMPORTANT: If you set the priority, you will need to attach Request listener using AddRequestInterceptor(Func<IRequest, Task>) instead of Request.

Returns

Task

Task.