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
FromCache
True if the response was served from either the browser's disk cache or memory cache.
bool FromCache { get; }
Property Value
FromServiceWorker
Gets a value indicating whether the IResponse was served by a service worker.
bool FromServiceWorker { get; }
Property Value
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
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
Methods
BufferAsync()
Returns a Task which resolves to a buffer with response body.
ValueTask<byte[]> BufferAsync()
Returns
JsonAsync(JsonDocumentOptions)
Returns a Task which resolves to a JsonDocument representation of response body.
Task<JsonDocument> JsonAsync(JsonDocumentOptions options = default)
Parameters
options
JsonDocumentOptionsParsing options.
Returns
- Task<JsonDocument>
A Task which resolves to a JsonDocument representation of response body.
- See Also
JsonAsync<T>(JsonSerializerOptions)
Returns a Task which resolves to a T
representation of response body.
Task<T> JsonAsync<T>(JsonSerializerOptions options = null)
Parameters
options
JsonSerializerOptionsParsing options.
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()