HTTP: requests and responses
HTTP is the set of rules the browser and the server use to exchange messages. The browser sends a request, that is, an ask such as “show me invoice 101,” and the server replies with a response. If the address starts with https, those messages are encrypted as they travel.
New here? Try the first lesson without an accountHow it works
A request carries a method, which says what you want to do (GET to read, POST to send data); a path, which says what it is about, such as /facturas/101; headers, which are extra named values such as the language or the cookie; and sometimes a body with content. The response brings a status code, a number that summarizes how the request went (200 means “it worked”), headers, and a body with the page or the data.
Expected behavior
The browser requests GET /perfil?id=7: method GET, path /perfil, and parameter id=7. The server answers 200, which means “it worked,” and sends the profile in the body.
What can go wrong
The server answers 200 but the body says “error,” or it answers 403 (“you are not allowed”) after saving the change anyway.
What to observe
Compare the full request and response: method, path, headers, code, and body. The address left in the browser bar does not show everything.
Common false positive
Using POST does not make an operation safe, and a GET request can also change data if the server was programmed that way.
Why it matters
If you only look at the address or only at the response number, you miss part of what happened: a request may have changed data even if the screen says otherwise.
How to fix it
The server must check permissions on every request, whatever the method and wherever it comes from. GET and POST are habits that organize the work, not locks.
Request and response
An HTTP request is text with fixed parts. The first line, such as GET /facturas/101, gives the method and the path. Below it come the headers, one per line, each with a name and a value: for example, the Cookie header carries the value that identifies you. A body may follow. The response works the same way: a status code, its headers, and a body with the invoice or with an error message.
What the codes say
The status code is a three-digit number that summarizes how the request was handled. 200 means it worked; 302, that you must go to another address; 403, that the server knows who you are but will not let you do that; 404, that it did not find what you asked for; 500, that something failed inside the server. It is only a summary: look at the body too, because a 200 can carry an error message.
Method is not permission
GET is usually used for reading and POST for sending something that changes data, but these are habits. If the server accepts a change through GET, it must still check permissions; if it accepts it through POST, that alone does not protect it. There may also be intermediaries along the way, such as a proxy that forwards messages or a cache that keeps copies. That is why it is worth saving the full request and the response that actually arrived.
