MockResponse class

Implemented types

Constructors

MockResponse(int status, {dynamic body, Encoding? encoding, Map<String, String>? headers, String? statusText})
MockResponse.badGateway({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.badRequest({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.forbidden({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.internalServerError({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.methodNotAllowed({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.notFound({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.notImplemented({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.ok({dynamic body, Map<String, String>? headers, String? statusText})
factory
MockResponse.unauthorized({dynamic body, Map<String, String>? headers, String? statusText})
factory

Properties

body HttpBody
This response's body. Provides synchronous access to the response body as bytes, text, or JSON.
no setteroverride
contentLength int
Gets and sets the content-length of the request, in bytes. If the size of the request is not known in advance, set this to null.
no setteroverride
contentType MediaType?
Content-type of this request.
no setteroverride
encoding Encoding?
Encoding that will be used to decode the response body. This encoding is selected based on contentType's charset parameter. If charset is not given or the encoding name is unrecognized, latin1 is used by default (RFC 2616).
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Headers sent with the response to the HTTP request.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
Status code of the response to the HTTP request. 200, 404, etc.
no setteroverride
statusText String
Status text of the response to the HTTP request. 'OK', 'Not Found', etc.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replace({List<int>? bodyBytes, String? bodyString, int? status, String? statusText, Map<String, String>? headers}) Response
Create a new Response using all the values from this instance except for the parameters specified.
override
toString() String
A string representation of this object.
inherited

Operators

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