IResponse Interface#
Represents an HTTP response received by the page.
public interface IResponse
Properties#
Frame Property#
Gets the frame that initiated the request for this response.
Motus.Abstractions.IFrame Frame { get; }
Property Value#
Headers Property#
Gets the response headers.
Motus.Abstractions.IHeaderCollection Headers { get; }
Property Value#
Ok Property#
Gets whether the response status code is in the 200-299 range.
bool Ok { get; }
Property Value#
Request Property#
Gets the request that generated this response.
Motus.Abstractions.IRequest Request { get; }
Property Value#
Status Property#
Gets the HTTP status code of the response.
int Status { get; }
Property Value#
StatusText Property#
Gets the HTTP status text of the response.
string StatusText { get; }
Property Value#
Url Property#
Gets the URL of the response.
string Url { get; }
Property Value#
Methods#
BodyAsync(CancellationToken) Method#
Returns the response body as a byte array.
System.Threading.Tasks.Task<byte[]> BodyAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<System.Byte[]>
The response body bytes.
JsonAsync<T>(CancellationToken) Method#
Deserializes the response body as JSON.
System.Threading.Tasks.Task<T> JsonAsync<T>(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Type parameters#
T
The expected deserialized type.
Parameters#
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<T>
The deserialized object.
TextAsync(CancellationToken) Method#
Returns the response body as text.
System.Threading.Tasks.Task<string> TextAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<System.String>
The response body text.