copyWith method

HttpRequestRecord copyWith({
  1. Map<String, String>? requestHeaders,
  2. String? requestBody,
  3. String? responseBody,
})

Copy with the capture payload replaced; every other field, atUs included, carries over so the copy keeps its place on the trace.

Implementation

HttpRequestRecord copyWith({
  Map<String, String>? requestHeaders,
  String? requestBody,
  String? responseBody,
}) =>
    HttpRequestRecord(
      url: url,
      method: method,
      statusCode: statusCode,
      durationMs: durationMs,
      isError: isError,
      timestamp: timestamp,
      requestHeaders: requestHeaders ?? this.requestHeaders,
      requestBody: requestBody ?? this.requestBody,
      responseBody: responseBody ?? this.responseBody,
      attributedHeuristically: attributedHeuristically,
      requestId: requestId,
      startUs: startUs,
      endUs: endUs,
      atUs: atUs,
      interactionId: interactionId,
      linkedBy: linkedBy,
    );