FetchResponse class

StreamedResponse with additional capability to cancel request and access to final (after redirects) request url.

Constructors

FetchResponse(Stream<List<int>> stream, int statusCode, {required void cancel(), required Uri url, required bool redirected, int? contentLength, BaseRequest? request, Map<String, String> headers = const {}, bool isRedirect = false, bool persistentConnection = true, String? reasonPhrase})
Creates a new cancelable streaming response.

Properties

cancel → void Function()
Cancels current request.
final
contentLength int?
The size of the response body, in bytes.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The HTTP headers returned by the server.
finalinherited
isRedirect bool
finalinherited
persistentConnection bool
Whether the server requested that a persistent connection be maintained.
finalinherited
reasonPhrase String?
The reason phrase associated with the status code.
finalinherited
redirected bool
Whether browser was redirected before loading actual resource.
final
request → BaseRequest?
The (frozen) request that triggered this response.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code for this response.
finalinherited
stream → ByteStream
The stream from which the response body data can be read.
finalinherited
url Uri
Target resource url (the one after redirects, if there are some).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited