readJson method

Future<Object?> readJson({
  1. int maxBytes = 10 * 1024 * 1024,
})

Reads and decodes a JSON body.

Implementation

Future<Object?> readJson({int maxBytes = 10 * 1024 * 1024}) async {
  final text = await readText(maxBytes: maxBytes);
  return text.isEmpty ? null : jsonDecode(text);
}