You can support this site from as little as $1 a month on Patreon.

The support pays for site hosting and the expansion of this content.

In addition, Patreon Supporters gain access to exclusive online video training courses and ebooks.

Join Now

How to complete the challenge PATCH /todos/id (200) partial

Use PATCH with Content-Type: application/json when you want to update selected fields on an existing todo. Partial JSON updates are an API-specific PATCH style.

PATCH /todos/id (200) partial

Issue a PATCH request to update an existing todo using a partial JSON payload.

  • Use PATCH /todos/{id} where {id} is an existing todo id.
  • Add Content-Type: application/json.
  • Send only the fields you want to change.
  • Do not include id in the payload.
  • The response should be 200.
  • Fields that are not in the payload should keep their existing values.
  • You can learn more about PATCH in the HTTP verbs tutorial.

Basic Instructions

  • Issue a PATCH request to:
    • https://apichallenges.eviltester.com/todos/{{firstTodoId}}
  • The request should have an X-CHALLENGER header so the challenge is tracked.
  • The request body can be a partial JSON object:
{
  "title": "patched partial todo"
}

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
> Accept: application/json
>
> {"title":"patched partial todo"}

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 partial todo",
  "doneStatus": false,
  "description": "existing description"
}