ResponseBody class

The response wrapper class for adapters.

This class should not be used in regular usages.

Constructors

ResponseBody(Stream<Uint8List> stream, int statusCode, {String? statusMessage, bool isRedirect = false, List<RedirectRecord>? redirects, void onClose()?, Map<String, List<String>>? headers})
ResponseBody.fromBytes(List<int> bytes, int statusCode, {String? statusMessage, bool isRedirect = false, void onClose()?, Map<String, List<String>>? headers})
ResponseBody.fromString(String text, int statusCode, {String? statusMessage, bool isRedirect = false, void onClose()?, Map<String, List<String>>? headers})

Properties

contentLength int
Content length of the response or -1 if not specified
no setter
extra Map<String, dynamic>
The extra field which will pass-through to the Response.extra.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, List<String>>
The response headers.
getter/setter pair
isRedirect bool
Whether this response is a redirect.
final
redirects List<RedirectRecord>?
Stores redirections during the request.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
HTTP status code.
getter/setter pair
statusMessage String?
Returns the reason phrase corresponds to the status code. The message can be HttpRequest.statusText or HttpClientResponse.reasonPhrase.
getter/setter pair
stream Stream<Uint8List>
The response stream.
getter/setter pair

Methods

close() → void
Closes the request & frees the underlying resources.
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