json method
Implementation
Future<dynamic> json() async {
final content = await text();
if (content.isEmpty) return null;
try {
return jsonDecode(content);
} catch (e) {
throw FormatException('Invalid JSON body: $e');
}
}
Future<dynamic> json() async {
final content = await text();
if (content.isEmpty) return null;
try {
return jsonDecode(content);
} catch (e) {
throw FormatException('Invalid JSON body: $e');
}
}