ResponseData class

A class that mimics HTTP Response in order to intercept it's data.

Constructors

ResponseData(Uint8List bodyBytes, int statusCode, {Map<String, String>? headers, String? body, int? contentLength, bool? isRedirect, bool? persistentConnection, RequestData? request})
Creates a new response data with body bytes.
ResponseData.fromHttpResponse(Response response)
Creates a new response data from an HTTP response.
factory

Properties

body String?
The body of the response as a string.
getter/setter pair
bodyBytes Uint8List
The bytes comprising the body of this response.
getter/setter pair
contentLength int?
The size of the response body, in bytes.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
getter/setter pair
isRedirect bool?
getter/setter pair
method Method?
Method of the request that triggered this response.
no setter
persistentConnection bool?
Whether the server requested that a persistent connection be maintained.
getter/setter pair
request RequestData?
The (frozen) request that triggered this response.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code for this response.
getter/setter pair
url String?
URL as String of the request that triggered this response.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toHttpResponse() → Response
Converts this response data to an HTTP response.
toString() String
Convenient toString implementation for logging.
override

Operators

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