Response class Null safety

A HTTP Response object.

Constructors

Response(int statusCode, String reasonPhrase, Headers headers, dynamic body, {List<RedirectInfo>? redirects, String? requestAddress, String? responseAddress})
Creates a HTTP Response object.

Properties

body → dynamic
HTTP body content.
read-only
bodyAsStream Stream<List<int>?>?
HTTP body content as Stream.
read-only
done Future
Completes when the underlying input stream has been read and completed.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
headers Headers
HTTP headers
final
reasonPhrase String
HTTP reason phrase
final
redirects List<RedirectInfo>?
The redirect steps that happened.
final
requestAddress String?
The remote address that the response was opened at.
final
responseAddress String?
The remote address that the response was returned from.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
statusCode int
HTTP Status code
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
readAsBytes() Future<List<int>>
Reads the body content as bytes.
readAsString({Encoding? encoding}) Future<String>
Reads the body content as String with encoding
toString() String
A string representation of this object.
inherited

Operators

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