How to complete the challenge GET /todos (200) ? filter description wildcard

How to issue a GET request on a top level entity endpoint and filter todos by matching the description with a wildcard pattern.

GET /todos (200) ? filter description wildcard

Issue a GET request on the /todos end point with a wildcard filter on description that returns todos with non-empty descriptions.

  • description*=*fixture* means return todos where the description contains fixture
  • * matches any number of characters
  • ? matches a single character
  • most tools and browsers will encode reserved characters for you when sending the request
  • every returned todo should have a non-empty matching description

Basic Instructions

  • Create or update a todo so it has a description containing fixture
  • Issue a GET request to end point "/todos"
    • https://apichallenges.com/todos
  • The request should have an X-CHALLENGER header to track challenge completion
  • Add a wildcard filter:
    • https://apichallenges.com/todos?description*=*fixture*
  • The response status code should be 200 because the request is accepted
  • Check that every returned description is non-empty and contains fixture

Try it now

If you need a matching todo, create one with a non-empty description containing fixture. See the solution.

POST /todos to create a wildcard filter fixture

Filter by wildcard:

GET /todos?description*=*fixture* to filter descriptions by wildcard

Example Request

> GET /todos?description*=*fixture* HTTP/1.1
> Host: apichallenges.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Accept: application/json

Example Response

< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json
< X-Challenger: x-challenger-guid

Returned body:

{
  "todos": [
    {
      "id": 9,
      "title": "wildcard filter fixture",
      "doneStatus": false,
      "description": "created fixture for wildcard filter"
    }
  ]
}
Experiment with this endpoint