The request-response cycle
What happens between a click and the displayed page: the request, the processing on the server, the response, the page's secondary requests and the absence of state between two requests.
- 26 cards
- 6 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- The numbers
- On the diagram
- Scenarios
A few cards from the deck
Client-server model: what is it?
Show the answer
An arrangement where one program sends requests and another processes them and answers, the two possibly running on remote machines.
On the web, the client is the browser and the server is the program that hosts the site. In HTTP, the client always takes the initiative: the server never speaks first.
What does this request ask for?
```http
GET /articles/42?lang=fr HTTP/1.1
Host: blog.example
Accept: text/html`- Read article 42, in French, as an HTML page
- Create an article numbered 42, written in French
- Edit article 42 to switch it to French
- Delete article 42 from the French version of the site
Show the answer
Read article 42, in French, as an HTML page
GETreads without changing anything;/articles/42names the resource;?lang=fris a parameter;Accept: text/htmlannounces the expected format. Creating, editing and deleting would usePOST,PUTorPATCH, andDELETE.The first line of an HTTP request, such as
GET /articles/42 HTTP/1.1, holds the …, the … and the protocol version.Show the answer
The first line of an HTTP request, such as
GET /articles/42 HTTP/1.1, holds the method, the path and the protocol version.The method says what to do (read, create, delete), the path says on which resource. The headers that follow give the context, for example the target site with
Host.