# Saved Copies: Working Offline

A program that calls a web API can save each answer to a JSON file with the date it was saved, fall back to that copy when a request fails, and take the function that fetches as a parameter, so tests can hand in a stand-in and never touch the network.

![Cheat sheet: Saved Copies: Working Offline](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/0289f3a81a1348ae901c35eb718c1297.webp)

- Category: Python
- Level: Journeyman
- Tags: Cache (software-development), Higher-Order Function (python), httpx, python, rest-api, Test Double, web-development
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-web-apis-saved-copies-cheat-sheet
