Mocking one endpoint at a time is fine for small tests. To keep a whole app working while the backend is down, the test server has been reset, or you are offline, Server Replay in HTTPS Capture is the better tool. Record the real traffic once, and from then on HTTPS Capture answers matching requests with the recorded responses.
How Server Replay works
A replay library stores the requests and responses from a session or a HAR file. When replay is on, each new request is matched by method and URL against the library. On a match, the recorded response is returned locally and the real server is never contacted. Replayed requests are marked with a purple Replay badge in the request list.
Step 1: Record a session
- Start capture and use the app normally, covering all the screens you want to work offline.
- Stop capture.
Step 2: Create a replay library
Use either method:
- In the session list, touch and hold the session and choose Create Replay Library.
- Or go to Rules → Server Replay, tap + and choose From Session… or Import HAR….
You can import HAR files exported from Chrome, Charles or another tool. The new library becomes the active one, but replay stays off until you turn it on. That way your traffic never changes unexpectedly.
Step 3: Turn on replay
On the Server Replay page, turn on Enable Server Replay. Now try the app, even in Airplane Mode. The screens you recorded load from the library.
Matching options
- Reuse responses: on by default, so the same response is returned every time. Turn it off to return each recorded response once, in order. This is useful for flows like “first call fails, second succeeds”.
- Refresh date headers: shifts
Date,Expires,Last-Modifiedand cookie expiry dates to the present, so cached content and cookies do not look stale. - Match request body: also compares the request body. Use this for APIs that send different POST bodies to the same URL.
- Ignore host / Ignore port: replays the recordings against another environment.
- Ignored query parameters (tap Add Parameter): list names such as
timestamp,nonceorsignthat change every time. Parameter order is ignored automatically.
When a request is not in the library
Under On miss, choose what happens to requests the library does not contain:
- Forward to server (default): send it to the real server as usual.
- Kill connection: drop the connection.
- Return status: return an empty response with a code you choose, such as 404.
Browse the library
Tap a library to see every recorded entry with its method, status, URL and body size, and open an entry to check its headers and body. You can keep several libraries and switch the active one with one tap.
Server Replay or Request Map?
Use Request Map to write one specific response by hand. Use Server Replay to serve a whole recorded backend.
Ready to try it?
HTTPS Capture · Capture and decrypt HTTPS traffic on iPhone
Free on the App Store