MatchRules class
A class representing a set of rules to determine if two requests match.
Constructors
- MatchRules()
- Creates a new MatchRules.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
byBaseUrl(
) → MatchRules - Enforces that both requests have the base URL (host).
-
byBody(
{List< CensorElement> ignoreElements = const []}) → MatchRules - Enforces that both requests have the same body.
-
byEverything(
) → MatchRules - Enforces that both requests are the exact same (headers, body, etc.).
-
byFullUrl(
{bool preserveQueryOrder = false}) → MatchRules - Enforces that both requests have the same full URL.
-
byHeader(
String headerKey) → MatchRules -
Enforces that both requests have the same header with the given
headerKey
. -
byHeaders(
{bool exact = false}) → MatchRules - Enforces that both requests have the same headers.
-
byMethod(
) → MatchRules - Enforces that both requests have the same HTTP method.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestsMatch(
Request received, Request recorded) → bool -
Returns true if the given
received
request matches the givenrecorded
request based on the configured rules. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- defaultMatchRules → MatchRules
-
A pre-configured set of rules that will match requests based on the full URL and method.
no setter
- defaultStrictMatchRules → MatchRules
-
A pre-configured set of rules that will match requests based on the full URL, method, and body.
no setter