A Tape is used to record and replay HTTP interactions.
It consists of:
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulevcr-0.1.0GHC2024
This module provides functionality for recording and replaying HTTP interactions using a tape. A tape represents a stored log of request/response pairs and can be operated in two modes:
AnyOrder (the default): Requests may be replayed in any order. In this mode the tape is interpreted as a mapping from requests to responses.
Sequential: Requests must be replayed in the order in which they were recorded. In this mode the tape is interpreted as a list of request/response pairs.
The module exports the following operations to work with tapes:
A Tape is used to record and replay HTTP interactions.
It consists of:
Represents the mode of operation for a tape.
SequentialRequests must be replayed in the order in which they were recorded.
AnyOrderRequests may be replayed in any order.
Execute an action with the given tape in read-write mode.
Replay interactions that have been recorded earlier.
Record new interactions that do not yet exist on the tape.
Use with when you want to both replay and record interactions.
Execute an action with the given tape in write mode.
Overwrite interactions that have been recorded earlier.
Record new interactions that do not yet exist on the tape.
Use record when you want to update a tape with new responses, replacing any existing interactions for a given request.
Execute an action with the given tape in read mode.
Replay interactions that have been recorded earlier.
Fail on new interactions that do not yet exist on the tape.
Use play when you want to test against recorded responses while at the same time also deny real HTTP requests for interactions that have not been recorded.