Table of Contents

Interface IResponse

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

IResponse class represents responses which are received by page.

public interface IResponse

Properties

Frame

A Frame that initiated this request. Or null if navigating to error pages.

IFrame Frame { get; }

Property Value

IFrame

FromCache

True if the response was served from either the browser's disk cache or memory cache.

bool FromCache { get; }

Property Value

bool

FromServiceWorker

Gets a value indicating whether the IResponse was served by a service worker.

bool FromServiceWorker { get; }

Property Value

bool

true if the IResponse was served by a service worker; otherwise, false.

Headers

An object with HTTP headers associated with the response. All header names are lower-case.

Dictionary<string, string> Headers { get; }

Property Value

Dictionary<string, string>

The headers.

Ok

Contains a boolean stating whether the response was successful (status in the range 200-299) or not.

bool Ok { get; }

Property Value

bool

true if ok; otherwise, false.

RemoteAddress

Remove server address.

RemoteAddress RemoteAddress { get; }

Property Value

RemoteAddress

Request

A matching Request object.

IRequest Request { get; }

Property Value

IRequest

The request.

SecurityDetails

Gets or sets the security details.

SecurityDetails SecurityDetails { get; }

Property Value

SecurityDetails

The security details.

Status

Contains the status code of the response.

HttpStatusCode Status { get; }

Property Value

HttpStatusCode

The status.

StatusText

Contains the status text of the response (e.g. usually an "OK" for a success).

string StatusText { get; }

Property Value

string

The status text.

Url

Contains the URL of the response.

string Url { get; }

Property Value

string

Methods

BufferAsync()

Returns a Task which resolves to a buffer with response body.

ValueTask<byte[]> BufferAsync()

Returns

ValueTask<byte[]>

A Task which resolves to a buffer with response body.

JsonAsync()

Returns a Task which resolves to a JObject representation of response body.

Task<JObject> JsonAsync()

Returns

Task<JObject>

A Task which resolves to a JObject representation of response body.

See Also

JsonAsync<T>()

Returns a Task which resolves to a T representation of response body.

Task<T> JsonAsync<T>()

Returns

Task<T>

A Task which resolves to a T representation of response body.

Type Parameters

T

The type of the response.

See Also

TextAsync()

Returns a Task which resolves to a text representation of response body.

Task<string> TextAsync()

Returns

Task<string>

A Task which resolves to a text representation of response body.

See Also