HttpTrafficCollector class abstract interface

Contract for coordinating HTTP traffic capture lifecycle events.

Implementations handle pending record creation, network simulation, duration calculation, and finalized capture recording into an InterceptlyEngine.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
maxBodyBytes → int
Maximum byte capacity for captured request/response bodies.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

begin({required String method, required Uri uri, Map<String, String>? headers, Uint8List? bodyBytes, String? contentType, String? requestId}) → Future<HttpCaptureScope>
Initiates an HTTP exchange capture, returning an HttpCaptureScope.
completeResponse({required HttpRequestContext context, required int statusCode, Map<String, String>? headers, Uint8List? bodyBytes, int? responseSizeBytes, int? durationMs, String? responseContentType, bool? responseTruncatedAtStorage}) → Future<void>
Records a successfully received HTTP response and applies post-response network simulation.
delayForChunk(int chunkBytes) → Duration
Calculates simulated throughput delay for streaming response chunks.
failRequest({required HttpRequestContext context, required Object error, String? errorType, String? errorMessage, int? statusCode, Map<String, String>? responseHeaders, Uint8List? responseBodyBytes, int? responseSizeBytes, int? durationMs, bool? responseTruncatedAtStorage}) → void
Records a failed HTTP request (transport error, connection error, or simulation failure).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldCapture(Uri? uri) → bool
Whether traffic to uri should be captured under the current session settings.
startRequest({required String method, required Uri uri, Map<String, String>? headers, Uint8List? bodyBytes, String? contentType, String? requestId}) → Future<HttpRequestContext?>
Records an initiated request and applies pre-request network simulation.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance ↔ HttpTrafficCollector
The active global HttpTrafficCollector instance.
getter/setter pair