SoftwareTestPilot

Follow a request from client to server and back. Simulated in your browser, free, no sign-in.

API Request & Response

Step 1 of 6

Now simulating · step 1 of 6

Client sends a request

Paused

Simplified model of how an application handles a request. It is not a packet-level network simulation; all timings are simulated.

Guided scenario: GET /products

Tip: click a coloured area or an edge line to see what it does.

Text description of this step
  • Scenario: 200: list products. Request: GET /products.
  • Client: pass. GET /products sent
Speed

Keyboard: Space plays or pauses (when not typing).

Learning objective: Read every part of an API exchange and assert status, headers, body and the stored side effect, not the status alone.

Step 1 · Beginner

Client sends a request

A request has a method (what to do), an endpoint (which resource), headers (extra information such as the body format) and sometimes a JSON body.

Expected outcome: Name the method, endpoint, headers and body in the request panel.

This is a simplified model of how an application processes a request, not a network simulation. The API is fictional and runs only in your browser.

Sample API contract (fictional Products API)
GET/products200 { data: Product[], count }
GET/products/:id200 Product
POST/products201 Product + Location header
PATCH/products/:id200 updated Product
DELETE/products/:id204, no body

Fields

  • name: Required on POST. Text, 1-60 characters.
  • sku: Required on POST. Format ABC-123 (3 capitals, dash, 3 digits). Must be unique.
  • price: Required on POST. Number greater than 0.
  • stock: Optional (default 0). Whole number, 0 or more.

Rules

  • POST and PATCH need Content-Type: application/json and a JSON object body.
  • PATCH needs at least one known field; unknown fields or an id in the body are rejected.
  • Validation problems return 400 { error, field? }. Other APIs may choose 422; the contract decides.
  • An id that does not exist returns 404 { error: "not_found" }.
  • A sku already used by another product returns 409 { error: "duplicate_sku" }.
  • An unexpected failure returns 500 { error: "internal_error" } and changes nothing.
  • Any other method on a path returns 405 with an Allow header.

Why the status code is not enough: a build can answer 201 without saving, or 200 with the wrong price. Check the body values, headers and a follow-up read too.

About this lesson

You will learn to

  • Identify method, endpoint, headers, body, status and response.
  • Explain what each stage of request handling checks.
  • Assert status, headers, body and side effects, not status alone.

Before you start

  • Know what JSON looks like.
  • Have heard of status codes like 200 and 404.

Your progress on this topic

Explored
0 of 6 guided steps viewed
Practiced
  • Not yet: Send a request from the console
  • Not yet: Send a request that fails (error status, timeout, fault or planted bug)
Challenges passed
  • Beginner: 0 of 3 · hints 0 · wrong answers 0
  • Practitioner: 0 of 3 · hints 0 · wrong answers 0
  • Advanced: 0 of 2 · hints 0 · wrong answers 0

Watching the walkthrough only counts as explored. Practice needs you to use the lab yourself, and a challenge passes only when your answer meets its criteria.

Practise more

Intentional failure: 400: a required field is missing

Nothing is posted anywhere. You choose where to paste the link or summary.

How to explain this in an interview

"I check four things on every API response: the status, the important headers such as Content-Type and Location, the body values against the contract, and the side effect with a separate read. A 201 that never saved the record, or a 200 with the wrong price, passes a status-only test, so I always follow a write with a GET and assert the values."

Try it on a real practice APISend real requests in the API Playground and check status, headers and body yourself.Next recommended topicAuthentication & Authorization

Progress is saved on this browser only. It is not linked to your account and other devices will not see it.