JsonConverter class

json.encode on Request and json.decode on Request Also add application/json header to each request

If content type header overrided using @Post(headers: {'content-type': '...'}) The converter won't add json header and won't apply json.encode if content type is not JSON

Implemented types
Annotations
  • @immutable

Constructors

JsonConverter()
const

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

convertError<BodyType, InnerType>(Response response) Response
override
convertRequest(Request request) Request
override
convertResponse<BodyType, InnerType>(Response response) Response<BodyType>
BodyType is the expected type of your response ex: String or CustomObject [...]
override
decodeJson<BodyType, InnerType>(Response response) Response
encodeJson(Request request) Request
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

requestFactory(Request request) Request
responseFactory<BodyType, InnerType>(Response response) Response<BodyType>