RequestData.fromJson constructor

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

Implementation

factory RequestData.fromJson(Map<String, dynamic> json) {
  return RequestData(
    url: json['url'] as String,
    urlFragment:
        json.containsKey('urlFragment')
            ? json['urlFragment'] as String
            : null,
    method: json['method'] as String,
    headers: Headers.fromJson(json['headers'] as Map<String, dynamic>),
    hasPostData:
        json.containsKey('hasPostData') ? json['hasPostData'] as bool : null,
    postDataEntries:
        json.containsKey('postDataEntries')
            ? (json['postDataEntries'] as List)
                .map((e) => PostDataEntry.fromJson(e as Map<String, dynamic>))
                .toList()
            : null,
    mixedContentType:
        json.containsKey('mixedContentType')
            ? security.MixedContentType.fromJson(
              json['mixedContentType'] as String,
            )
            : null,
    initialPriority: ResourcePriority.fromJson(
      json['initialPriority'] as String,
    ),
    referrerPolicy: RequestReferrerPolicy.fromJson(
      json['referrerPolicy'] as String,
    ),
    isLinkPreload:
        json.containsKey('isLinkPreload')
            ? json['isLinkPreload'] as bool
            : null,
    trustTokenParams:
        json.containsKey('trustTokenParams')
            ? TrustTokenParams.fromJson(
              json['trustTokenParams'] as Map<String, dynamic>,
            )
            : null,
    isSameSite:
        json.containsKey('isSameSite') ? json['isSameSite'] as bool : null,
  );
}