Frontend · interactive
CORS
Your app at app.example.com fetches from api.partner.com. Browsers block scripts from reading responses from another origin unless that server opts in with CORS headers. For anything beyond a simple request, the browser asks first with a preflight.
Browser → api.partner.com
GET /orders Origin: https://app.example.com
api.partner.com → browser
200 OK [data] (no Access-Control-Allow-Origin)
TypeError: Failed to fetch (CORS)
Request reached the server: yes
The request reached the server and it answered, but the browser refuses to hand the response to your JavaScript. CORS limits reading, not sending.
Scenario
Step 4 of 4 · read left to right
In production
Tools and technologies
Cross-origin requests are governed by CORS in every browser.
Not tied to one language — use these names when you search docs or design a system.