CxNetworkCaptureRule class

Defines when and what network data to capture for a matching request.

Rules are evaluated in list order — the first matching rule wins. At least one of url or urlPattern must be supplied per rule. When both are provided, url is checked first as an exact match; urlPattern is only evaluated if the exact match does not succeed. Both fields act as OR conditions within the same rule.

Constructors

CxNetworkCaptureRule({String? url, String? urlPattern, List<String>? reqHeaders, List<String>? resHeaders, bool collectReqPayload = false, bool collectResPayload = false})

Properties

collectReqPayload → bool
When true, captures the request body.
final
collectResPayload → bool
When true, captures the response body.
final
compiledPattern → RegExp?
Returns the pre-compiled pattern, or null if no urlPattern was provided.
no setter
hashCode → int
The hash code for this object.
no setterinherited
reqHeaders → List<String>?
Allowlist of request header names to capture (case-insensitive). When null, no request headers are captured for matching requests.
final
resHeaders → List<String>?
Allowlist of response header names to capture (case-insensitive). When null, no response headers are captured for matching requests.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
url → String?
Exact URL string to match against the full request URL.
final
urlPattern → String?
Regex pattern matched against the full request URL.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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