LAB 14 OF 31

Read an API response

Read one Daily List API reply and decide what each part tells you.

The diagram

Mei calls the Daily List tasks API to add a task. The reply is status 201, a header Location: /tasks/48, and a body {"id": 48, "title": "Buy milk", "done": false}. This training API requires a non-empty title and creates a new task with done false. The status is the server’s claim; a separate readback checks the persisted result. Answer what each part tells her.

  1. What does status 201 tell Mei?
  2. What is the Location header for?
  3. Which check on the body is most useful?
  4. Mei sends the same request with no title. What status would show the app handled it well?

0 of 4 steps chosen.

SYNTHETIC / TRAINING ONLY. The Daily List app and the people in it are made up, and every number is a teaching figure.

What this shows

A reply has a status code, headers and a body. A tester reads each part and checks it against what was expected.

Read the lessons

NEXT LAB: SQL: FIND THE BAD ROW →