Transformer class abstract

Transformer allows changes to the request/response data before it is sent/received to/from the server.

Dio has already implemented a BackgroundTransformer, and as the default Transformer. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the BackgroundTransformer by setting the Dio.Transformer.

Implementers

Constructors

Transformer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transformRequest(RequestOptions options) Future<String>
transformRequest allows changes to the request data before it is sent to the server, but after the RequestInterceptor.
transformResponse(RequestOptions options, ResponseBody responseBody) Future
transformResponse allows changes to the response data before it is passed to ResponseInterceptor.

Operators

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

Static Methods

isJsonMimeType(String? contentType) bool
See https://mimesniff.spec.whatwg.org/#json-mime-type.
urlEncodeMap(Map<String, dynamic> map, [ListFormat listFormat = ListFormat.multi]) String
Recursively encode the Map<String, dynamic> to percent-encoding. Generally used with the "application/x-www-form-urlencoded" content-type.
urlEncodeQueryMap(Map<String, dynamic> map, [ListFormat listFormat = ListFormat.multi]) String
Deep encode the Map<String, dynamic> to a query parameter string.