What you are doing
An API lets one program ask another for data. Here, you will ask TestKru for a list of sample users, inspect its reply, and record three facts. Everything you need is on this page.
1. Send your request
Find Send your request. The method GET means “read data”; the URL is the address to contact. Both are already filled in. Leave them unchanged and click Send request. You do not need to open Optional request settings.
2. Read the response and answer
The API's reply appears below the button under Response from TestKru. Use it to fill in the three answer fields:
- Status code: copy the number labelled Status code. This API should return
200, meaning it handled the request successfully. - First user's name: in Response body, find the first object's
namefield. Type only the name, without quotation marks. Square brackets[ ]surround the user list; braces{ }surround each user object. - Content-Type (media type): read Content-Type above the response body. It tells you the data format. Enter only the part before any semicolon. For example, from
application/json; charset=utf-8, enterapplication/json.
Your first successful GET is selected automatically for checking. The selected request connects your answers to the response you inspected. If you retry and want to use a different response, open Choose a different recorded request.
3. Submit your answers
Click Submit Answers. The result appears below Submit Answers, with your score and a result for each check. If a check needs attention, correct that answer and submit again. When all checks pass, this assignment is complete and saved. Click Continue to the next lesson to move on.
What this teaches you
The status tells you how the request was handled; Content-Type describes the response format; the body contains the actual data. Check all three. A 200 status alone does not prove every field is correct.
Optional self-review
In your own words, what is the difference between the request URL, response status, and response body? If you received no reply at all, could you call that a 404? You do not need to submit a written self-review to continue.
The users are fictional. If you receive 429, wait a minute and try again; it means too many requests, not a successful user-list response.