encodeBody property

Object? Function()? encodeBody
final

A callback that handles the serialization of the request body.

Usually used to transform a Map or Object into a JSON String, XML, or any other format required by the server.

Example:

encodeBody: () => json.encode({'name': 'John'})

Implementation

final Object? Function()? encodeBody;