API Testing Challenge – How To – GET todos 200

This post and video shows how to complete the challenge GET /todos 200 using Insomnia.

What are the API Challenges?

Our API Challenges Application has a fully functional cloud hosted API, and a set of challenges to work through.

GET /todos (200)

Issue a GET request on the /todos end point

  • This will show you all the todos in the system
  • The return format is a useful guide for the syntax of the request you will send in POST messages
  • Perform a GET prior to any amendment or deletion, to make sure that the data in the system is what you expect it to be.
  • remember not to add a trailing / on the request e.g. /todos/ – that is a different end point

Basic Instructions

  • Issue a GET request to end point “/todos”
    • if running locally that would be
      • http://localhost:4567/todos
    • if running in the cloud that would be
      • https://apichallenges.herokuapp.com/todos
  • The request should have an X-CHALLENGER header
  • The response body shows all the todos.

Insomnia Details

> GET /todos HTTP/1.1
> Host: apichallenges.herokuapp.com
> User-Agent: insomnia/2020.3.3
> X-CHALLENGER: x-challenger-guid
> Accept: */*
< HTTP/1.1 200 OK
< Connection: close
< Date: Fri, 28 Aug 2020 13:15:04 GMT
< Content-Type: application/json
< X-Challenger: x-challenger-guid
< Server: Jetty(9.4.z-SNAPSHOT)
< Via: 1.1 vegur

Response Example

{
  "todos": [
    {
      "id": 6,
      "title": "process payroll",
      "doneStatus": false,
      "description": ""
    },
    {
      "id": 9,
      "title": "tidy meeting room",
      "doneStatus": false,
      "description": ""
    }
   ]
}

Overview Video

Patreon ad free version

Learn More and Start Testing

<p>
<strong><a href="https://www.eviltester.com/ebooktop6">Read our free ebook</a> on the Software Testing books you Must Read (and Why)</strong>
</p>
Source: EvilTester
API Testing Challenge – How To – GET todos 200

Share This Post

Show Buttons
Hide Buttons