How the web talks: an introduction to HTTP
Follow a request from browser to server and learn methods, headers and status codes.
A web request
A browser acts as a client: it sends a request and receives a response from a server. HTTP defines the structure of this conversation. You only need a browser and its developer tools for this lesson.
Read a request
In HTTP/1.1, the first line identifies the method and path. GET retrieves a resource. Host identifies the destination, while Accept indicates a preferred response format. The example below is a textual request, not a terminal command.
GET /api/lessons HTTP/1.1
Host: example.test
Accept: application/jsonUnderstand the response
200 indicates success, 404 means the resource was not found, and 500 indicates a server error. Content-Type describes the response format, such as HTML or JSON.
HTTP/1.1 200 OK
Content-Type: application/json
{"lessons": ["HTTP", "Python"]}No video or audio has been uploaded for this section yet. The written notes are available.
No separate download has been attached yet.
Learning ping-pong
⌑ Practice unlocks after you mark this section as studied.
✦ Your AI learning companion
Ask for a simpler explanation, another example or a hint.
Instructor’s hint
Look at the first request line.
The tutor is available to enrolled students.