What you will learn
A status code arrives in an HTTP response. A connection failure can prevent any response from arriving. A 404 means a responding server did not find the requested resource; it is not a connection failure.
Your goals
- Compare a valid resource and an unknown ID.
- Separate transport failure from an HTTP error.
Before you start
Read the previous lesson first if you have not already. This course does not require programming.
Practice setup
These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.
Supplied training evidence / contract
Controlled failure transcript: GET https://testkru.com/api/users/1 → connection failed before HTTP response; status: none; response headers: none; response body: none. This is supplied evidence. Do not break your network to reproduce it.
Follow these steps
- Send the known-user request and select that response.
- Send the unknown-user request and select that response. An error status can still be a useful result.
- Read the connection-failure transcript. Notice whether it includes a status code.
- Copy the unknown-user status from the response you selected. Then classify the 404 and the connection transcript.
- Submit Answers.
Investigate before concluding
First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.
What to keep as evidence
- Known and missing resources have separate evidence.
- 404 is correctly classified as an HTTP response.
- The connection failure has no invented HTTP result.
References for this lesson
Finish this assignment
Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.
If something goes wrong
- Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
- Known and missing resources have separate evidence.
- 404 is correctly classified as an HTTP response.
- The connection failure has no invented HTTP result.
If an API returns 500, can its server have responded? Explain using the same distinction.
Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.