A BaseResponse with a url field.
Client methods that return a BaseResponse subclass, such as Response
or StreamedResponse, may return a BaseResponseWithUrl.
For example:
final client = Client();
final response = client.get(Uri.https('example.com', '/'));
Uri? finalUri;
if (response case BaseResponseWithUrl(:final url)) {
finalUri = url;
}
// Do something with `finalUri`.
client.close();
url will be added to BaseResponse when package:http
version 2 is
released and this mixin will be deprecated.
- Implemented types
- Available extensions
Properties
- 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
- 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
- url → Uri
-
The Uri of the response returned by the server.
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