Request Headers
Cheat sheet · https://pcornel.dk/topic.php?topic=5301
Answer
Metadata sent with an API request such as content negotiation, authorization, conditional state, tracing and client context.
Remember
- Header present ≠ header honored; proxies, gateways or server policy may strip or override it.
- Authorization header ≠ authorization granted; token validity and policy evaluation remain separate.
- Content-Type ≠ payload valid; it only declares representation format.
- Client-supplied tracing header ≠ trustworthy identity; correlation and security identity must remain distinct.
First checks
curl -v <url> 2>&1 | grep '^>'— request headers sent- Content-Type and Accept — formats
- User-Agent identifying the automation — traceability
Verify in this order
client headers → server interpretation
Where it usually breaks
A request header proves caller intent only; server or intermediary handling determines its actual effect.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
Request Headers API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5301