SentryRequest.fromJson constructor

SentryRequest.fromJson(
  1. Map<String, dynamic> data
)

Deserializes a SentryRequest from JSON Map.

Implementation

factory SentryRequest.fromJson(Map<String, dynamic> data) {
  final json = AccessAwareMap(data);
  return SentryRequest(
    url: json['url'],
    method: json['method'],
    queryString: json['query_string'],
    cookies: json['cookies'],
    data: json['data'],
    headers: json.containsKey('headers') ? Map.from(json['headers']) : null,
    env: json.containsKey('env') ? Map.from(json['env']) : null,
    // ignore: deprecated_member_use_from_same_package
    other: json.containsKey('other') ? Map.from(json['other']) : null,
    fragment: json['fragment'],
    apiTarget: json['api_target'],
    unknown: json.notAccessed(),
  );
}