Glossary Term
HTTP Request
Learn what an HTTP request is and how clients send messages to servers. Understand request structure, methods, headers, and body components.
TL;DR: An HTTP request is the message a client sends when it wants something from a server, whether that means loading a page, fetching API data, or submitting a form.
An HTTP request is the start of almost every interaction on the web. A browser sends one when you click a link. A frontend app sends one when it calls an API. A script sends one when it uploads a file or polls for status.
What A Request Is Really Saying
At a high level, every request answers four questions:
- what action do you want
- which resource are you talking about
- what context or rules matter
- are you sending any data along with it
That maps directly to the parts of the request:
- method:
GET,POST,PUT,DELETE, and so on - target: the URL or path
- headers: metadata like accepted formats, auth, cookies, and caching context
- body: optional content such as JSON, form fields, or binary data
A Simple Example
POST /api/login HTTP/1.1
Host: app.example.com
Content-Type: application/json
{"email":"dev@example.com","password":"secret"}
That request is saying:
- perform a
POST - send it to
/api/login - interpret the body as JSON
- here is the data you need to process
Why Requests Matter In Debugging
A lot of HTTP bugs are not response bugs. They begin with the wrong request:
- wrong method, so the route does not match
- missing
Authorization, so the server returns401 - wrong
Content-Type, so the backend fails to parse the body - wrong
Origin, so the browser enforces CORS rules - stale cookies, so a session appears to belong to a different user
When you inspect a bug, start by confirming the request you think you sent is the request that actually went over the wire.
Request Body Or No Request Body
Not every request includes a body.
GETandHEADusually do notPOST,PUT, andPATCHoften doDELETEmay or may not, depending on the API contract
That is one reason method choice matters so much: clients, frameworks, caches, and browsers make assumptions based on it.
Good Practical Habit
If you are learning HTTP, read requests left to right:
- method
- path
- interesting headers
- body
That habit turns noisy network traces into something you can reason about quickly.
Related terms: HTTP Response, HTTP Method, HTTP Header
Frequently Asked Questions
What is an HTTP request?
An HTTP request is a message sent by a client to a server asking for a resource or action. It includes method, URL, headers, and optionally a body.
What are the parts of an HTTP request?
A request usually includes a method, target URL, headers, and sometimes a body. In raw HTTP/1.1, that appears as a request line, headers, a blank line, and then the body.
What is the request body?
The body contains data sent to the server, used with POST, PUT, and PATCH. It can be form data, JSON, files, or other payload formats.
How do I see HTTP requests?
Use the browser Network panel, `curl -v`, proxy tools, or server logs. Those tools show which request was sent and what the server saw.