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
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" }
| Method | Meaning | Safe to repeat? |
|---|---|---|
| GET | Read data | Yes |
| POST | Create something | No — repeating may create duplicates |
| PUT | Replace a resource | Yes (idempotent) |
| PATCH | Partly update a resource | Depends on implementation |
| DELETE | Remove a resource | Yes (idempotent) |
Status codes worth knowing
| Code | Meaning | What to check |
|---|---|---|
| 200 / 201 | OK / Created | Body contains the correct data |
| 204 | No content | Nothing expected in the body |
| 301 / 302 | Redirect | Final URL is correct; no redirect loops |
| 400 | Bad request | Validation message is clear and helpful |
| 401 | Not authenticated | Login required, no data leaked |
| 403 | Forbidden | User is known but not allowed |
| 404 | Not found | Friendly page; no stack traces |
| 409 | Conflict | Duplicate or outdated update handled |
| 429 | Too many requests | Rate limiting works |
| 500 / 502 / 503 | Server-side failure | Always 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,SameSiteand 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
- Correct status code and response schema for valid requests
- Validation for missing, extra, wrong-type and boundary values
- Authentication and authorisation for every endpoint and role
- Idempotency: what happens if the same request arrives twice?
- Pagination, sorting and filtering on large data sets
- Error messages that help, without leaking internals
- Performance: response time under realistic load