How to complete the challenge PUT /api/todos no id (422)
Issue a PUT request to /api/todos without an id in the URL or the request body.
The /api/todos endpoint exists, but the API cannot know which todo to update. Because the request reaches a valid endpoint but is missing required update information, the response should be 422 Unprocessable Content.
Basic Instructions
- Send
PUT /api/todos - Add an
X-CHALLENGERheader to track challenge completion - Set
Content-Typetoapplication/json - Do not include an
idfield in the JSON payload - Include a valid
titleso the missing identifier is the relevant error - Verify the response status is
422
Example body:
{
"title": "missing identifier",
"doneStatus": false,
"description": "no id in URL or body"
}
Try it now
PUT /api/todos without an id in the URL or payload
Lessons Learned
PUT /api/todoswithout anyidleaves the server unable to identify the resource to replace.- A full representation still needs a target identity for update semantics.
422 Unprocessable Contentcan signal missing addressing information, not just bad field data.
Suggested Experiments
- Add only the body
idand compare this failure with the successfulPUT /api/todosbody-id challenge. - Send the same no-id payload to
POST /api/todosand observe whether create semantics differ.