An integration is a script that talks to another system's API. With the requests library, a call looks like requests.get(url, params=..., headers=..., timeout=10) or requests.post(url, json=body, ...).
In these exercises requests is a stand-in with the same calls, answered by a test server that runs in your browser, so nothing reaches the internet. The habits are the real ones:
- Authenticate with a header such as
Authorization: Bearer <token>.
- Always set a timeout. Without one, a server that never answers hangs your script.
- Send JSON with
json=, and read the status code before the body.
- Follow cursors until the API says there is no next page.
- Retry only what can succeed later (429, 502, 503), wait longer each time, and respect
Retry-After.
- Use an idempotency key on a POST you might retry, so the server can recognize the repeat.
Out: (401, {'error': 'missing token'}). The error body is JSON too, which is why the status comes first.