Skip to content
CodeKruPro

Tell an HTTP error from no response at all

Automation taskEasy

After "How do you debug a failing API test?" often comes "What if there is no status code at all?" This lesson shows the difference between a server that answered with an error and a request that never reached a server.

Tell an HTTP error from no response

01 · Read and understand requests

Recommended first: Read objects, lists and nested JSON fields

Your goal: Tell an HTTP error from no response

Follow one request at a time. Send it yourself, then select that response before you answer.

  1. 1Send requests
  2. 2Submit answers

Start here: sign in to practise.

Jump to practice

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

  1. Send the known-user request and select that response.
  2. Send the unknown-user request and select that response. An error status can still be a useful result.
  3. Read the connection-failure transcript. Notice whether it includes a status code.
  4. Copy the unknown-user status from the response you selected. Then classify the 404 and the connection transcript.
  5. 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.

Open API reference

Practise and save your evidence

The lesson is public. Sign in to send requests and save progress. You will return to this lesson.

Sign in to practiseCreate an account