Programming foundations · L1 · 20 min
HTTP and JSON
Learn in five minutes
- HTTP is a request and a response.
- JSON is the text shape most model APIs use for messages.
- A status code is part of the result, not a decoration.
- RFC 9110 defines HTTP semantics. RFC 8259 defines JSON.
- Confirm the vendor's current path before you copy a sample.
A client that ignores status 401 will treat an auth failure as an empty answer. Read the status, then the body.
Visual
Read a toy response
- Write a JSON object with role and content.
- Pretend the status is 200 and parse it.
- Pretend the status is 401 and stop before you treat the body as an answer.
Quiz
Ecosystem
- Status code
- The number HTTP uses to say how the request finished.
Sisters: Git, HTTP, JSON, unit tests.
A Python script can later call a local runner or a cloud API with the same JSON shape.
The same notebook becomes the capstone log.
Config
- Write the goal in one sentence.
- Name the input and the allowed output.
- Save the trace next to the result.
Troubleshooting
- The answer looks fluent and is wrong. Check whether a source passage actually contains the claim.
- The loop never stops. Set a step cap and stop when the tool result repeats.
Sources and go deeper
- RFC 9110, HTTP Semantics spec last checked 2026-10
- RFC 8259, The JSON Data Interchange Format spec last checked 2026-10
- HTTP — Wikipedia wikipedia last checked 2026-10
- JSON — Wikipedia wikipedia last checked 2026-10