HTTP is the set of rules browsers and apps use to ask a web server for something.
This guide is for people new to security or IT who want to read a web request and know what each line means. You do not need to code. Many apps, bots and AI agents talk to each other with these same requests, so the skill is useful well beyond websites.
In short
- Every web visit is a request from your device and a response from a server.
- A request has a method (what you want to do), a path (what you want), headers (extra details) and sometimes a body (data you send).
- Sign-in proof travels in headers as cookies or tokens. Whoever copies them may be able to act as you.
- HTTPS scrambles requests and responses on the way, so others on the network cannot read those secrets.
What you will learn
- Read the main parts of a web request and a response.
- Explain what the common methods GET and POST do.
- Spot where cookies, tokens and error messages appear.
- Check that sign-in cookies use the basic safety settings.
- Question to a server (request)
- a message from a browser or app asking a server to do or send something.
- Extra label lines (headers)
- short name and value lines that add details to a request or a response.
- Small note from a site (cookie)
- a piece of data a server asks your browser to keep and send back later.
What is HTTP?
Think of ordering at a shop counter with a written order slip. You write what you want, add a few notes, and hand it over. The shop hands back your item with a receipt that says whether it went well.
HTTP works the same way. It is the protocol (agreed set of rules) behind every exchange of data on the web [1]. The browser or app sends a message called a request. The server answers with a response [1].
Where the comparison stops working: a shop assistant remembers your face. A web server, by itself, does not link one request to the next [1]. Sites use cookies or tokens so they can recognise you on each request.
For the trip a request takes across the internet, see How the Web Works for Beginners. This page zooms in on the request and response themselves.
Why does it matter?
Most attacks on websites and apps arrive as ordinary-looking requests. Being able to read one is a core skill for anyone in security.
If you are new to security work
What could happen: you see an alert full of request lines and cannot tell which part matters.
Check this: practise naming the method, path, headers and status in a few real requests from your own browser.
If you support users or apps
What could happen: someone pastes a full request into a ticket, and it includes their sign-in cookie or token.
Check this: remove Cookie and Authorization lines before you share or store a request.
If you build or buy web apps
What could happen: error replies show internal details that help an attacker plan.
Check this: ask what users see when something fails, and what is kept in the logs instead.
What does it look like?
Here is a made-up request and response. You can see ones like it in your browser's tools.
Example only. All values are made up.
POST /account/address HTTP/1.1 (1) Host: shop.example.com (2) Cookie: session=FAKE-SESSION-0000 (3) Authorization: Bearer EXAMPLE-TOKEN-0000 (4) street=1 Example Road (5) HTTP/1.1 200 OK (6) Set-Cookie: session=FAKE-SESSION-0000; Secure; HttpOnly; SameSite=Lax (7)
- The method (POST, which sends data) and the path (what it is about).
- A header naming the website the request is for.
- In a real file, this line would contain a session cookie that proves you are signed in.
- In a real file, this line would contain a token that lets an app act for you.
- The body: the data being sent, here a new address.
- The response's status code. 200 means the request worked.
- The server setting a cookie with three safety settings turned on.
Why this is risky: lines 3 and 4 are like keys. Anyone who copies them may be able to act as that user.
The safer way: use HTTPS only. Remove cookies and tokens before you share a request. Turn on the safety settings for sign-in cookies.
How does it work?
- The client picks a method and a path. GET asks for something and should only read data. POST sends data, often to change something on the server [2].
- It adds headers. Headers carry extra details, such as which site is wanted or the language you prefer [1].
- It adds proof of who you are. This is often a cookie the site set earlier [3], or a credential in the Authorization header [4].
- The server replies with a status code. Codes in the 200s mean success, 300s mean go elsewhere, 400s mean a problem with the request and 500s mean the server failed [5].
- The response carries headers and usually a body. The body is the page, file or data you asked for [1].

Two status codes often confuse people. A 401 means the server does not know who you are yet. A 403 means it knows who you are, but you are not allowed [5].
Cookies have three safety settings worth knowing. Secure means the cookie is only sent over HTTPS. HttpOnly stops scripts on the page from reading it, which helps against some script attacks. SameSite limits when the cookie goes with requests from other sites [3].
A bearer token is a token that works for whoever holds it [6]. The standard for these tokens says they should not be put in page addresses and must be sent over an encrypted connection [6].
A worked example
Vida Lindahl works on the help desk at a small travel firm. A customer says the "update address" button on the website gives an error. Vida's team lead asks her to look at the request before passing it to the developers.
Vida opens the browser's developer tools and repeats the action on a test account. She finds the request. The method is POST and the path is the account address page. So far, it looks normal.
The response status is 500, a server error. The body shows a long technical message. It names the database the site uses and part of the code that failed. Vida knows from her training that details like this can help an attacker, so she flags it.
Next, she gets ready to write the ticket. She copies the request and notices two lines: a Cookie line and an Authorization line. Both hold the test account's sign-in proof. She deletes the values and writes "removed" in their place.
The developers fix the fault. They also change the error page so users see a short message, while the full detail goes to the logs that only staff can read.
Vida's lead adds a rule to the help desk guide: before you attach a request to a ticket, remove cookies, tokens and passwords. Vida also checks the site's sign-in cookie in the tools. It shows Secure and HttpOnly, but no SameSite setting, so she adds a note for the developers to review it.
Myths and mistakes
| What people think | What is true |
|---|---|
| A GET request cannot change anything. | GET should only read data, but that depends on how the site was built. Check before assuming. |
| A cookie is just for adverts. | Many cookies hold sign-in sessions. Copying one may let someone act as you. |
| The basic sign-in header is encrypted. | Basic sign-in only encodes the name and password, which is easy to reverse. HTTPS is what protects it. |
| A 401 and a 403 mean the same thing. | 401 means "who are you?". 403 means "we know who you are, and the answer is no". |
| Detailed error messages help users. | They can reveal internal details to anyone. Show a short message and keep detail in the logs. |
What can I do this week?
- Open your browser's tools and look at one request on a site you trust.
- Find the method, path, status code and one header in that request.
- Check whether your own site's sign-in cookie shows Secure, HttpOnly and SameSite.
- Agree a team rule to remove cookies and tokens before sharing a request.
Checklist
- I can name the four parts of a request.
- I know what GET and POST are for.
- I can explain the five groups of status codes.
- I know the difference between a 401 and a 403.
- I know which headers can carry sign-in proof.
- I remove cookies and tokens before sharing a request.
- Our sign-in cookies use Secure, HttpOnly and SameSite.
- Our error pages show short messages, with detail kept in logs.
Common questions
What is the difference between HTTP and HTTPS?
HTTPS is HTTP sent inside an encrypted connection. The request and response look the same to the browser and server. On the way, though, the content is scrambled, so others on the network should not be able to read cookies, tokens or form data.
What is a header?
A header is one line of extra detail in a request or response, written as a name and a value. Examples include the site name, the preferred language, a cookie or a sign-in token. Servers and browsers read headers to decide how to handle the message.
Is a token the same as a cookie?
Not quite. Both can prove you are signed in. A cookie is stored by the browser and sent back to the site that set it. A token is often handled by an app and sent in the Authorization header. Either one, if copied, may let someone act as you.
Why should tokens stay out of web addresses?
Because web addresses tend to be copied, saved and shared more widely than headers. The standard for bearer tokens says they should not be put in page addresses. It advises sending them in headers or the body, over an encrypted connection, instead.
Do AI agents and apps use HTTP too?
Yes. Many apps, bots and AI agents call other services with web requests, using tokens or keys in headers. These are non-human identities. Their tokens need the same care as a person's sign-in cookie, and often more, because they may hold wide access.
Where next?
Ready for the detail? Read the practitioner guide: HTTP Request Smuggling Guide. It goes further into how the headers that mark where a request ends can be misread by proxies and servers, and how teams harden them.
Also useful:
- How the Web Works for Beginners
- Cookies and Online Tracking for Beginners
- Bearer Tokens for Beginners
- HTTP Authentication Schemes Reference
Related NHI Mgmt Group resources: TLS and HTTPS for Beginners, Cross-Site Request Forgery for Beginners and Non-Human Identities for Beginners.
Key terms
- HTTP
- The rules browsers and apps use to send requests to web servers and get responses.
- HTTP header
- A name and value line that adds details to a request or response.
- HTTP method
- The word at the start of a request, such as GET or POST, that says what the client wants to do.
- Status code
- A three-digit number in a response that says whether the request worked and, if not, why.
- A cookie that keeps you signed in to a site between requests.
- Bearer token
- A token that gives access to whoever holds it, so it must be kept secret.
- HTTPS
- HTTP sent inside an encrypted connection.
Sources and further reading
- MDN Web Docs (Mozilla), "Overview of HTTP", last modified 8 October 2026. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Overview (accessed 1 Dec 2026).
- MDN Web Docs (Mozilla), "HTTP request methods". https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods (accessed 1 Dec 2026).
- MDN Web Docs (Mozilla), "Using HTTP cookies". https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies (accessed 1 Dec 2026).
- MDN Web Docs (Mozilla), "Authorization header". https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization (accessed 1 Dec 2026).
- MDN Web Docs (Mozilla), "HTTP response status codes". https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status (accessed 1 Dec 2026).
- M. Jones and D. Hardt, "The OAuth 2.0 Authorization Framework: Bearer Token Usage", RFC 6750, IETF, October 2012, sections 1.2 and 5.3. https://www.rfc-editor.org/rfc/rfc6750 (accessed 1 Dec 2026).