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

Delete a todo item in the application

How to complete the challenge DELETE /todos/id (204) to successfully delete a todo item in the application.

DELETE /todos/id (204)

Issue a DELETE request to successfully delete a todo

  • DELETE request will delete a todo if the provided id exists /todos/id end point
    • e.g. DELETE /todos/3 to delete the todo with id==3
  • 204 is a success code, in this case it means the todo was deleted and there is no response body
  • add the X-CHALLENGER header

Basic Instructions

  • Issue a DELETE request to end point "/todos/id"
    • where id is replaced with the id of an existing todo
      • if you don't know any then a GET /todos would show a list of todos, or you could POST /todos to create one.
    • e.g using endpoint
      • https://apichallenges.eviltester.com/todos/id
  • The request should have an X-CHALLENGER header to track challenge completion
  • The response status code should be 204 when all the details are valid and the todo exists.
  • To double check that the todo item was deleted, then you could issue a GET request on the todo directly and receive a 404 or issue a GET request on /todos and check it is not in the list of todos.

Try it now

If you do not have a todo to delete, create one first:

Then delete an existing todo:

Example Request

> DELETE /todos/62 HTTP/1.1
> Host: apichallenges.eviltester.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Accept: */*

Example Response

< HTTP/1.1 204 No Content
< Connection: close
< Date: Thu, 27 Aug 2020 14:25:53 GMT
< X-Challenger: x-challenger-guid
< Server: Jetty(9.4.z-SNAPSHOT)
< Via: 1.1 vegur