toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'url': url,
    'method': method,
    'headers': headers.toJson(),
    'initialPriority': initialPriority.toJson(),
    'referrerPolicy': referrerPolicy,
    if (urlFragment != null) 'urlFragment': urlFragment,
    if (postData != null) 'postData': postData,
    if (hasPostData != null) 'hasPostData': hasPostData,
    if (postDataEntries != null)
      'postDataEntries': postDataEntries!.map((e) => e.toJson()).toList(),
    if (mixedContentType != null)
      'mixedContentType': mixedContentType!.toJson(),
    if (isLinkPreload != null) 'isLinkPreload': isLinkPreload,
    if (trustTokenParams != null)
      'trustTokenParams': trustTokenParams!.toJson(),
    if (isSameSite != null) 'isSameSite': isSameSite,
  };
}