# Headers and Body

This page explains how each line after the request line is classified as a header or as body.

## Header

After the request line and before the body starts, a line containing `:` is split at the first `:` into key and value (both trimmed). The key must pass `checkHeader`:

| Condition | Example |
|-----------|---------|
| Starts with an ASCII letter | `X-Api-Key` passes, `1Key` fails |
| Contains only letters, digits, `-`, `_` | `Content_Type` passes, `Content Type` fails |
| Line does not start with `"` | `"key": "value"` is always body |

A line that fails becomes the first body line. Headers are stored in a `map`, so the last line wins for duplicate keys.

## Body

Everything after any of the following belongs to the body, until the next `###` or request line:

| Trigger | Description |
|---------|-------------|
| Blank line | The standard form: one blank line between headers and body |
| `{` or `[` on its own line | JSON may follow the headers without a blank line |
| A line that fails header validation | That line itself is the first body line |

The body is the raw lines (indentation preserved) joined with `\n`.

See [.http File Format](/http-file-format) for request block and comment rules.
