# HTTP headers parser

Turn a raw block of HTTP headers into JSON, explain the well-known ones and audit security headers.

- Endpoint: `POST https://setget.net/v1/tools/http-headers-parse` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `http-headers-parse`
- Page: https://setget.net/tools/http-headers-parse

## Inputs

- `text` (required, string): The raw headers, as copied from curl -i or the browser developer tools.
- `audit` (optional, boolean, default `false`): List common security headers that are missing.

## Example 1

```json
{"input":{"text":"HTTP/1.1 200 OK\nContent-Type: text/html; charset=UTF-8\nCache-Control: max-age=600"}}
```

Result:

```json
{"start_line":{"type":"response","version":"1.1","status":200,"reason":"OK"},"count":2,"headers":{"content-type":"text/html; charset=UTF-8","cache-control":"max-age=600"},"explained":{"content-type":{"meaning":"The format of the body, and for text its character set.","media_type":"text/html","charset":"utf-8","boundary":null},"cache-control":{"meaning":"How browsers and shared caches may store and reuse the response.","directives":[{"name":"max-age","value":600,"meaning":"The response is fresh for 10 minutes. Caches may reuse it without asking the server during that time."}],"summary":"Browsers may reuse it for 10 minutes without contacting the server; shared caches such as CDNs may reuse it for 10 minutes.","warnings":[]}},"skipped":[],"audit":null}
```

## Example 2: Security header audit

```json
{"input":{"text":"x-frame-options: DENY\nx-content-type-options: nosniff\nreferrer-policy: no-referrer","audit":true}}
```

Result:

```json
{"start_line":null,"count":3,"headers":{"x-frame-options":"DENY","x-content-type-options":"nosniff","referrer-policy":"no-referrer"},"explained":{"x-frame-options":{"meaning":"Whether other sites may show this page inside a frame."},"x-content-type-options":{"meaning":"With \"nosniff\", browsers do not guess a different content type."},"referrer-policy":{"meaning":"How much of the page address is sent to other sites in the Referer header."}},"skipped":[],"audit":{"present":["X-Content-Type-Options","X-Frame-Options","Referrer-Policy"],"missing":[{"header":"Strict-Transport-Security","why":"Tells browsers to use HTTPS only. Without it a visit can be downgraded to plain HTTP."},{"header":"Content-Security-Policy","why":"Limits where scripts and other resources may load from, which contains injected code."},{"header":"Permissions-Policy","why":"Switches off browser features the page does not need, such as camera or location."}]}}
```

**What happens to a header that appears twice?** Its values are returned as a list, in the order they appeared.

**Does the audit prove a site is secure?** No. It only reports which widely recommended headers are absent from the text you pasted.

**Is the body read?** No. Parsing stops at the first blank line after the headers.
