How to complete the challenge GET /todos (200) ? filter description regex
How to issue a GET request on a top level entity endpoint and filter todos by matching the description with a regular expression.
GET /todos (200) ? filter description regex
Issue a GET request on the
/todosend point with a regular expression filter on description that returns todos with non-empty descriptions.
description~=.*fixture.*means return todos where the description matches the regular expression- most tools and browsers will encode any reserved characters for you when sending the request
- the response should contain at least one todo
- every returned todo should have a non-empty
description - every returned description should match the regular expression
Basic Instructions
- Create or update a todo so it has a description containing
fixture - Issue a
GETrequest to end point "/todos"https://apichallenges.eviltester.com/todos
- The request should have an
X-CHALLENGERheader to track challenge completion - Add a regular expression filter:
https://apichallenges.eviltester.com/todos?description~=.*fixture.*
- The response status code should be
200because 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 regex filter fixture
Filter by regular expression:
GET /todos?description~=.*fixture.* to filter descriptions by regex
Example Request
> GET /todos?description~=.*fixture.* HTTP/1.1
> Host: apichallenges.eviltester.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": 8,
"title": "regex filter fixture",
"doneStatus": false,
"description": "created fixture for regex filter"
}
]
}