Summary: Client and Server

The final test quiz of the whole client-server introductory series: check how well you have absorbed the material. A cheat sheet on methods and response codes comes first, followed by 23 questions on every topic covered.

About the product

Alex, QA Team Lead

Hi! You’ve completed the whole introductory series on the client and the server: GET, POST, PATCH, PUT, DELETE and response codes. Great work! All that’s left is to put it all together.

Quick reference

Client, server and database

The client sends a request, the server processes it, goes to the database if needed, and returns a response. The client never goes to the database directly.

JSON

The data in a response usually comes in JSON. An object is in curly braces { } with “key: value” pairs, a list of objects is in square brackets [ ]. An empty list [] means “no data”, not an error.

Methods and CRUD

POST /api/v1/products — create (201 Created), GET /api/v1/products — read (200 OK), PATCH /api/v1/products/3 — change part of the data, PUT /api/v1/products/3 — replace completely (both 200 OK), DELETE /api/v1/products/3 — delete (204 No Content).

Repeating requests

GET can be repeated any number of times: it changes nothing. Every POST creates a new record, so a repeat gives a duplicate. A repeated DELETE doesn’t change the database, but returns 404.

Response codes

2xx is success (200 with an empty list is a success too). 4xx is a client error: 401 — not logged in, 404 — not found, 405 — the method is not allowed. 5xx is a server error: 500 — something broke, 503 — the server is temporarily overloaded.

What a tester checks

The response code, the data in the database and what the user sees: a clear message, an up-to-date list, no hanging.