Table of Contents

Class Response

Namespace
PuppeteerSharp
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 Response : IResponse
Inheritance
Response
Implements

Properties

Frame

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

public IFrame Frame { get; }

Property Value

IFrame

FromCache

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

public bool FromCache { get; }

Property Value

bool

FromServiceWorker

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

public bool FromServiceWorker { get; }

Property Value

bool

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

Headers

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

public 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.

public bool Ok { get; }

Property Value

bool

true if ok; otherwise, false.

RemoteAddress

Remove server address.

public RemoteAddress RemoteAddress { get; }

Property Value

RemoteAddress

Request

public Request Request { get; }

Property Value

Request

SecurityDetails

Gets or sets the security details.

public SecurityDetails SecurityDetails { get; }

Property Value

SecurityDetails

The security details.

Status

Contains the status code of the response.

public HttpStatusCode Status { get; }

Property Value

HttpStatusCode

The status.

StatusText

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

public string StatusText { get; }

Property Value

string

The status text.

Url

Contains the URL of the response.

public string Url { get; }

Property Value

string

Methods

BufferAsync()

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

public 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.

public 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.

public 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.

public Task<string> TextAsync()

Returns

Task<string>

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