Skip to content
Cyber Courses

12 min · enseigne: http-request

Anatomy of an HTTP request

Method, path, headers, body, and the response that comes back.

Every interaction with a web server is a request and a response. The request says what you want (a method and a path) and carries metadata in headers. The response comes back with a status code, its own headers and usually a body. Nothing else is magic, once you can read these four parts, you can read any web traffic.

Send a request, read the response

Request

GET /api/invoices/INV-20507 HTTP/1.1
Host: portal.globex.example
Accept: application/json

Response

Send the request to see the response.

Notice the status line. 200 means the server handled the request; 4xx means your request was the problem (wrong path, missing auth); 5xx means the server itself failed. The status code is the first thing to read, always.

A request comes back 401. What does that tell you?