DefaultHttpTrafficCollector class

Default implementation of HttpTrafficCollector backed by InspectorSession.

Implemented types

Constructors

DefaultHttpTrafficCollector({InspectorSession? session})
Creates a collector backed by session or InspectorSession.instance.

Properties

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

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.
override
completeResponse({required HttpRequestContext context, required int statusCode, Map<String, String>? headers, Uint8List? bodyBytes, int? responseSizeBytes, int? durationMs, String? responseContentType}) → Future<void>
Records a successfully received HTTP response and applies post-response network simulation.
override
delayForChunk(int chunkBytes) → Duration
Calculates simulated throughput delay for streaming response chunks.
override
failRequest({required HttpRequestContext context, required Object error, String? errorType, String? errorMessage, int? statusCode, Map<String, String>? responseHeaders, Uint8List? responseBodyBytes, int? responseSizeBytes, int? durationMs}) → void
Records a failed HTTP request (transport error, connection error, or simulation failure).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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.
override
toString() → String
A string representation of this object.
inherited

Operators

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