toMap method

Map<String, Object?> toMap()

Convert request information to map format for reporting

Implementation

Map<String, Object?> toMap() {
  return {
    'startTime': startTime.millisecondsSinceEpoch,
    'url': url.toString(),
    'responseUrl': responseUrl != null ? responseUrl.toString() : '',
    'method': method,
    'duration': duration.inMilliseconds,
    'statusCode': statusCode,
    'contentLength': contentLength,
    'isSuccess': isSuccess,
    'errorMessage': errorMessage,
    'traceId': traceId,
  };
}