Converter class abstract interface

An interface for implementing request and response converters.

Converters convert objects to and from their representation in HTTP.

convertRequest is called before RequestInterceptors and convertResponse is called just after the HTTP response, before ResponseInterceptors.

See JsonConverter and FormUrlEncodedConverter for example implementations.

Implementers
Annotations
  • @immutable

Constructors

Converter()

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

convertRequest(Request request) FutureOr<Request>
Converts the received Request to a Request which has a body with the HTTP representation of the original body.
convertResponse<BodyType, InnerType>(Response response) FutureOr<Response<BodyType>>
Converts the received Response to a Response which has a body of the type BodyType.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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