HTTP Fundamentals
HTTP messages are requests and responses.
HTTP messages are requests and responses.
Request example
GET /account HTTP/1.1
Host: example.test
Accept: text/html
A request includes a method, path, version, headers and sometimes a body. Common methods include GET, POST, PUT, PATCH and DELETE.
Response example
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
<h1>Account</h1>
Common status groups are:
2xxsuccess.3xxredirection.4xxclient-side error or denied request.5xxserver error.
Headers can control caching, content interpretation and browser security behavior. Treat every request value as untrusted, even when it comes from a hidden form field or client-side script.