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 QUERY /todos (200)

QUERY is a safe read method that lets you send query content in the request body. For this challenge, use it to request todos where doneStatus=true.

QUERY /todos (200)

Issue a QUERY request on the /todos end point with form-encoded query content to get only todos which are done. There must exist both done and not done todos to pass this challenge.

  • Use the QUERY method with /todos.
  • Add Content-Type: application/x-www-form-urlencoded.
  • Add Accept: application/json if you want a JSON response.
  • Send doneStatus=true in the request body.
  • Make sure your challenger data has at least one todo with "doneStatus": true and at least one with "doneStatus": false.

Basic Instructions

  • Issue a QUERY request to:
    • https://apichallenges.eviltester.com/todos
  • The request should have an X-CHALLENGER header so the challenge is tracked.
  • The request body should be form URL encoded:
doneStatus=true

Try it now

Create a done TODO if necessary:

Then issue the QUERY request with the filter in the body:

Example Request

> QUERY /todos HTTP/1.1
> Host: apichallenges.eviltester.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Content-Type: application/x-www-form-urlencoded
> Accept: application/json
>
> doneStatus=true

Example Response

< HTTP/1.1 200 OK
< Content-Type: application/json
< Accept-Query: application/x-www-form-urlencoded
< X-Challenger: x-challenger-guid

Returned body:

{
  "todos": [
    {
      "id": 41,
      "title": "done todo for query",
      "doneStatus": true,
      "description": "created for query challenge"
    }
  ]
}