toHttpActivity method

HttpActivity toHttpActivity(
  1. DioError e
)

Implementation

HttpActivity toHttpActivity(DioError e) {
  return HttpActivity(
      response: HttpResponse(
    responseStatusCode: e.response?.statusCode,
    responseStatusMessage: e.response?.statusMessage,
    createdAt: DateTime.now().millisecondsSinceEpoch,
    responseBody: e.response?.data,
    contentType: e.response?.headers.map['content-type']?.first ?? 'Unknown',
    responseHeader: e.response?.headers.map,
    responseSize: _byteUtil.stringToBytes(e.response?.data.toString() ?? ""),
    requestHashCode: e.requestOptions.hashCode,
  ));
}