Response class

Fetch-like HTTP response model.

Constructors

Response({Object? body, int status = HttpStatus.ok, String? statusText, Headers? headers, Uri? url, bool redirected = false})
Response.bytes(List<int> body, {int status = HttpStatus.ok, String? statusText, Headers? headers, Uri? url, bool redirected = false})
factory
Response.empty({int status = HttpStatus.noContent, String? statusText, Headers? headers, Uri? url, bool redirected = false})
factory
Response.json(Object? body, {int status = HttpStatus.ok, String? statusText, Headers? headers, Uri? url, bool redirected = false})
factory
Response.redirect(Uri location, {int status = HttpStatus.found, Headers? headers})
factory
Response.text(String body, {int status = HttpStatus.ok, String? statusText, Headers? headers, Uri? url, bool redirected = false})
factory

Properties

body Stream<Uint8List>?
no setterinherited
bodyData → BodyData
final
bodyMimeTypeHint String?
Optional MIME hint used by blob.
no setter
bodyUsed bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
headers Headers
final
ok bool
no setter
redirected bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
final
statusText String
final
url Uri?
final

Methods

blob() Future<Blob>
inherited
bytes() Future<Uint8List>
inherited
clone() Response
copyWith({Object? body = _sentinel, int? status, String? statusText, Headers? headers, Uri? url, bool? redirected}) Response
json<T>() Future<T>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
text([Encoding encoding = utf8]) Future<String>
inherited
toString() String
A string representation of this object.
inherited

Operators

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