← QA Library
Chapter 5 / 9 · 8 min de lecture

Web, networks and APIs

How the web works from a tester's point of view: client and server, HTTP, status codes, APIs, authentication, cookies and caching.

Most of today's products are web applications or talk to servers over the internet. A tester who understands what happens between a click and a response finds bugs faster and writes reports developers can act on immediately.

From click to response

BrowserDNSCDN / cacheWeb serverAPIDatabase
A simplified request path. A problem can hide at any step, and DevTools shows most of them.

When you open a page, the browser resolves the domain name through DNS, connects to a server (often via a CDN), sends an HTTP request and renders the response. The front end then calls APIs for data, and the server reads and writes a database.

Anatomy of an HTTP request

POST /api/orders HTTP/1.1
Host: shop.example.com
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json

{ "items": [{ "sku": "HOODIE-M", "qty": 1 }], "promo": "SPRING10" }
MethodMeaningSafe to repeat?
GETRead dataYes
POSTCreate somethingNo — repeating may create duplicates
PUTReplace a resourceYes (idempotent)
PATCHPartly update a resourceDepends on implementation
DELETERemove a resourceYes (idempotent)

Status codes worth knowing

CodeMeaningWhat to check
200 / 201OK / CreatedBody contains the correct data
204No contentNothing expected in the body
301 / 302RedirectFinal URL is correct; no redirect loops
400Bad requestValidation message is clear and helpful
401Not authenticatedLogin required, no data leaked
403ForbiddenUser is known but not allowed
404Not foundFriendly page; no stack traces
409ConflictDuplicate or outdated update handled
429Too many requestsRate limiting works
500 / 502 / 503Server-side failureAlways a bug report with logs and time

API styles

REST exposes resources over HTTP with standard methods and JSON. GraphQL uses one endpoint where the client asks for exactly the fields it needs. gRPC uses compact binary messages and is common between internal services. WebSocket keeps a two-way connection open for real-time updates such as chats, notifications and multiplayer games.

Authentication and authorisation

Authentication proves who you are (login, password, one-time code, single sign-on). Authorisation decides what you're allowed to do. Many serious bugs are authorisation bugs: try changing an ID in the URL or request (/orders/1042 → /orders/1043) and check that another user's data is never returned.

Where the browser keeps data

  • Cookies: small values sent with every request; check HttpOnly, Secure, SameSite and expiry for session cookies
  • localStorage / sessionStorage: data kept in the browser; never store passwords or tokens with broad access here
  • Cache: browsers and CDNs keep copies of files; after a release, users may see an old version if caching is wrong

API testing checklist

  1. Correct status code and response schema for valid requests
  2. Validation for missing, extra, wrong-type and boundary values
  3. Authentication and authorisation for every endpoint and role
  4. Idempotency: what happens if the same request arrives twice?
  5. Pagination, sorting and filtering on large data sets
  6. Error messages that help, without leaking internals
  7. Performance: response time under realistic load
Open DevTools (F12) on every test session. The Network and Console tabs turn “it doesn't work” into a precise, fixable bug report.