HTTP: An HTTP request

What’s in a request?

The first thing is the URL, which we’ve already seen before.

When we enter an address and press enter in our browser, under the hoods the server sends to the correct IP address a request like this:

GET /a-page

where /a-page is the URL you requested.

The second thing is the HTTP method (also called verb).

HTTP in the early days defined 3 of them:

  • GET
  • POST
  • HEAD

and HTTP/1.1 introduced

  • PUT
  • DELETE
  • OPTIONS
  • TRACE

We’ll see them in detail in a minute.

The third thing that composes a request is a set of HTTP headers.

The client sets request headers to communicate something to the server when we make a request.

For example the client can set an authorization token, or a cookie, or set a language.

And the server can use response headers to communicate information back.

For example, the content encoding, the content type, when it was last modified, etc.

Finally, in some kinds of requests (POST and PUT requests) we can have a request body.

Lessons in this unit:

0: Introduction
1: ▶︎ An HTTP request
2: HTTP Methods
3: HTTP Status Codes
4: HTTP Client/Server communication
5: HTTP Request Headers
6: HTTP Response Headers
7: HTTPS
8: HTTP/2
9: HTTP/3
Want to learn more? Check out our courses