json method

FliqRequest json(
  1. Map<String, dynamic> data
)

Sets the request body to the JSON-encoded data.

Example:

final response = await client.post('https://example.com').json({'key': 'value'}).go();

Implementation

FliqRequest json(Map<String, dynamic> data) {
  _request
    ..headers.contentType = ContentType.json
    ..write(jsonEncode(data));
  return this;
}