Why does my request work in curl but fail in the browser?
curl does not enforce CORS; only browsers do. The server must return the right Access-Control headers for the browser to let your page read the response.
Describe the cross-origin request your page makes, paste the response headers the server sent, and get the verdict the browser would reach, step by step, with the same reason the console would print.
Loading the workbench.
You do not have to take our word that your headers stay here. Developer tools show every request a page makes, so you can watch this page work and confirm that nothing is sent. The check takes under a minute.
F12, or Cmd+Option+I on a Mac, and select the Network tab.Only two things can add a line to that log, and neither carries your headers. Submitting the feedback form sends the vote and comment you typed. Typing characters in a script the page has not displayed yet, such as Cyrillic or Greek, can make the browser fetch the matching font file, and that request names only the font.
2http never sends a request on your behalf: the request builder writes code for you to run, and the meta inspector reads source you paste instead of fetching a URL. The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint.
A cross-origin request goes straight to the server only if it is simple. Anything else is preceded by an OPTIONS preflight that asks permission first. The checker applies the Fetch Standard rules and tells you which part of your request triggers the preflight:
Each failure is shown with the wording the browser console uses, so you can match it to the error you are seeing.
Several rules catch experienced developers. The * wildcard in Allow-Headers and Allow-Methods does not apply to credentialed requests, and in Allow-Headers it never covers Authorization, which must be listed by name. Origins are compared as exact strings, so a trailing slash or a different letter case fails. Allowing the null origin is risky because sandboxed iframes send it.
The checker also warns when an echoed origin is missing Vary: Origin, when no Access-Control-Max-Age makes every request pay for a preflight, and which response headers JavaScript can actually read.
Not directly. CORS is enforced by the browser to protect users: it decides whether a script on one site may read a response from another. The request may still reach your server. Server-side authorization still has to be correct; CORS only relaxes the same-origin policy, it never adds protection beyond it.
Elsewhere in 2http: Security header audit, Request builder, Meta tag generator, HTTP status codes, MIME types, and all eleven lanes on the 2http home page. Part of the 2suite.io privacy-first ecosystem.
curl does not enforce CORS; only browsers do. The server must return the right Access-Control headers for the browser to let your page read the response.
No. With credentials the server must return the exact requesting origin and Access-Control-Allow-Credentials: true. Browsers reject the wildcard in that case.
Content-Type: application/json is not one of the three simple content types, so the browser sends a preflight to ask permission before the real request.
No. It evaluates the headers you paste against the Fetch Standard rules in this tab. It never contacts your server.