How to Debug HTTP Headers, CORS and Cache
Headers explain a lot of confusing API and browser behavior: CORS failures, stale cache, unexpected content types, cookies and security rules.
Where to get headers
- Browser DevTools: open Network, select the request and copy request or response headers.
- curl: run a request with header output and copy the response header block.
- Server logs or proxy logs: copy the raw header lines from the failing request.
Fields to inspect first
Content-Type: confirms whether the response is JSON, HTML, text or another format.Cache-Control: explains whether a browser or proxy may reuse an old response.Access-Control-Allow-Origin: central for browser CORS behavior.Authorization: confirms whether the request sent an auth header.Set-Cookie: shows cookie attributes such as path, expiry, SameSite and Secure.Content-Security-Policy: can block scripts, frames, images or network requests.
Debugging workflow
- Copy the raw headers from the real failing request.
- Parse them into a structured view.
- Check content type, cache, CORS, auth, cookies and security headers.
- Compare a failing request with a working request.
- Fix the server or client configuration, then repeat the same request.
Use the tool
Open the HTTP Headers Parser Online to convert pasted request or response headers into readable JSON locally in your browser.