JokerResponse.json constructor
JokerResponse.json(})
Creates a successful response with JSON body
Implementation
factory JokerResponse.json(
Map<String, dynamic> json, {
int statusCode = 200,
Map<String, String> headers = const {},
Duration? delay,
}) {
final jsonHeaders = {
'content-type': 'application/json; charset=utf-8',
...headers,
};
return JokerResponse(
statusCode: statusCode,
headers: jsonHeaders,
body: jsonEncode(json),
delay: delay,
);
}