RequestInterceptedEvent.fromJson constructor
RequestInterceptedEvent.fromJson(
- Map<String, dynamic> json
)
Implementation
factory RequestInterceptedEvent.fromJson(Map<String, dynamic> json) {
return RequestInterceptedEvent(
interceptionId: InterceptionId.fromJson(json['interceptionId'] as String),
request: RequestData.fromJson(json['request'] as Map<String, dynamic>),
frameId: page.FrameId.fromJson(json['frameId'] as String),
resourceType: ResourceType.fromJson(json['resourceType'] as String),
isNavigationRequest: json['isNavigationRequest'] as bool? ?? false,
isDownload:
json.containsKey('isDownload') ? json['isDownload'] as bool : null,
redirectUrl: json.containsKey('redirectUrl')
? json['redirectUrl'] as String
: null,
authChallenge: json.containsKey('authChallenge')
? AuthChallenge.fromJson(
json['authChallenge'] as Map<String, dynamic>)
: null,
responseErrorReason: json.containsKey('responseErrorReason')
? ErrorReason.fromJson(json['responseErrorReason'] as String)
: null,
responseStatusCode: json.containsKey('responseStatusCode')
? json['responseStatusCode'] as int
: null,
responseHeaders: json.containsKey('responseHeaders')
? Headers.fromJson(json['responseHeaders'] as Map<String, dynamic>)
: null,
requestId: json.containsKey('requestId')
? RequestId.fromJson(json['requestId'] as String)
: null,
);
}