toJson method
Returns the JSON representation of the response. This is called by the JSON encoder to produce the response.
Implementation
Map<String, dynamic> toJson() => {
if (body != null) 'body': body,
'isBase64Encoded': isBase64Encoded,
'statusCode': statusCode,
if (headers != null) 'headers': headers
};