# HTTP Request

> Learn what an HTTP request is and how clients send messages to servers. Understand request structure, methods, headers, and body components.

Source: https://howhttpworks.com/glossary/request
Last reviewed: 2026-10-04

> **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

```http
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 returns `401`
- wrong `Content-Type`, so the backend fails to parse the body
- a cross-origin call, so the browser enforces CORS rules and may send a preflight first
- 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.

- `GET` and `HEAD` usually do not
- `POST`, `PUT`, and `PATCH` often do
- `DELETE` may 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:

1. method
2. path
3. interesting headers
4. body

That habit turns noisy network traces into something you can reason about quickly.

**Related terms:** [HTTP Response](https://howhttpworks.com/glossary/response), [HTTP Method](https://howhttpworks.com/glossary/method), [HTTP Header](https://howhttpworks.com/glossary/header)
