toJson method
Implementation
@override
Object toJson() {
return {
if (status.isNotDefault) 'status': status,
if (reason.isNotDefault) 'reason': reason,
if (headers.isNotDefault) 'headers': encodeList(headers),
if (body != null) 'body': encodeBytes(body),
};
}