How to complete the challenge PUT /api/todos/{id} not found (404)
Issue a PUT request to /api/todos/{id} where the URL id does not exist, and do not include an id in the request body.
This is an update attempt against a specific URL resource. Since that resource does not exist, the response should be 404 Not Found.
Basic Instructions
- Send
PUT /api/todos/{id}where{id}does not exist - Add an
X-CHALLENGERheader to track challenge completion - Set
Content-Typetoapplication/json - Do not include an
idfield in the JSON payload - Include a valid
title - Verify the response status is
404
Example body:
{
"title": "missing todo",
"doneStatus": false,
"description": "URL id does not exist"
}
Try it now
PUT /api/todos/{id} with a missing URL id and no body id
Lessons Learned
- A valid
PUTbody cannot update a resourceidthat does not exist. 404 Not Foundhere is about the target path resource, not body validation.- Missing-resource update tests should keep the payload valid so the status is unambiguous.
Suggested Experiments
- Reuse the same payload against an existing
idand compare200 OKwith the missing-id404 Not Found. - Create a new todo after the failed update and check that the failed
PUTdid not create thatid.