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
using
A closure that accepts two arguments, a
Track
instance andURLRequest
instance. If the closure returnstrue
it is assumed that theTrack
matches for a givenURLRequest
. If the closure returnsfalse
it is assumed that theTrack
does match for a givenURLRequest
.