How to complete the challenge PATCH /todos/id (200) json-patch
Use PATCH with Content-Type: application/json-patch+json when you want to send a JSON Patch operation list.
PATCH /todos/id (200) json-patch
Issue a PATCH request to update an existing todo using JSON Patch operations.
- Use
PATCH /todos/{id}where{id}is an existing todo id. - Add
Content-Type: application/json-patch+jsonfor the JSON Patch standard. - Send an array of JSON Patch operations.
- The response should be
200. - Use JSON Pointer paths such as
/title,/description, or/doneStatus. - You can learn more about PATCH in the HTTP verbs tutorial.
Basic Instructions
- Issue a
PATCHrequest to:https://apichallenges.eviltester.com/todos/{{firstTodoId}}
- The request should have an
X-CHALLENGERheader so the challenge is tracked. - The request body can be a JSON Patch operation array:
[
{
"op": "replace",
"path": "/title",
"value": "patched with json patch"
}
]
Try it now
Example Request
> PATCH /todos/3 HTTP/1.1
> Host: apichallenges.eviltester.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Content-Type: application/json-patch+json
> Accept: application/json
>
> [{"op":"replace","path":"/title","value":"patched with json patch"}]
Example Response
< HTTP/1.1 200 OK
< Content-Type: application/json
< Accept-Patch: application/json, application/merge-patch+json, application/json-patch+json
< X-Challenger: x-challenger-guid
Returned body:
{
"id": 3,
"title": "patched with json patch",
"doneStatus": false,
"description": "existing description"
}