RequestLog.fromJson constructor

RequestLog.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory RequestLog.fromJson(Map<String, dynamic> json) {
  return RequestLog(
    timestamp: json['timestamp'] ?? '',
    method: json['method'] ?? '',
    path: json['path'] ?? '',
    remoteAddr: json['remoteAddr'] ?? '',
    userAgent: json['userAgent'] ?? '',
    contentType: json['contentType'] ?? '',
    headers: Map<String, String>.from(json['headers'] ?? {}),
    query: Map<String, String>.from(json['query'] ?? {}),
    body: json['body'] ?? '',
    statusCode: json['statusCode'] ?? 0,
    durationMs: json['durationMs'] ?? 0,
  );
}