MatchType
public enum MatchType
A type the defines a property by which a Track and URLRequest are compared to see
if they are a match.
In order to properly replay previously recorded requests, VHS can match HTTP requests to a previously recorded one.
-
The HTTP method (i.e. GET, POST, PUT or DELETE) of the request.
Declaration
Swift
case method
-
The full URI of the request.
Declaration
Swift
case url
-
The path of the URI.
Declaration
Swift
case path
-
The query string values of the URI. The query string ordering does not affect matching results (it’s order-agnostic).
Declaration
Swift
case query
-
The request headers.
Declaration
Swift
case headers
-
The body of the request.
Declaration
Swift
case body
-
A custom closure or function that can be defined outside of VHS.
Declaration
Swift
case custom(using: (Track, URLRequest) -> Bool)Parameters
usingA closure that accepts two arguments, a
Trackinstance andURLRequestinstance. If the closure returnstrueit is assumed that theTrackmatches for a givenURLRequest. If the closure returnsfalseit is assumed that theTrackdoes match for a givenURLRequest.
MatchType Enum Reference