saveResponse method

Future<void> saveResponse(
  1. Response response,
  2. int requestHashCode
)

Implementation

Future<void> saveResponse(Response response, int requestHashCode) async {
  var payload = HttpResponse(
    createdAt: DateTime.now().millisecondsSinceEpoch,
    responseHeader: _jsonUtil.encodeRawJson(response.headers).toString(),
    responseBody: _jsonUtil.encodeRawJson(response.body).toString(),
    responseStatusCode: response.statusCode,
    responseStatusMessage: response.reasonPhrase.toString(),
    responseSize: _byteUtil.stringToBytes(response.body.toString()),
    requestHashCode: requestHashCode,
  );
  await networkInspector!.writeHttpResponseLog(payload);
}