☆
2
curl works but browser fetch gets CORS error — what is actually different?
I can POST to our internal API with curl and get a 200. The same request from fetch() in the browser fails with a CORS error before the server sees anything. I added `Access-Contro…
Top answer · @kevinz
curl is not a browser, so it does not enforce the same-origin policy. The browser sends an OPTIONS preflight first because your request has a JSON content type and a custom header.