SteelReed

Search

Search posts, questions…

Web & REST APIQuestion 4 / 25

Middle

What is CORS, and why does Postman reach the API while the browser reports a CORS error?

Short answer

CORS is a browser rule: JS on site A may only read server B's response if B allows it with Access-Control-Allow-Origin. Postman isn't blocked, so CORS doesn't protect your API.

preflight OPTIONS ifneededAccess-Control-Allow-Originheader matchesno matchno CORSJS on origin Abrowserserver origin BJS can readJS read blockedPostman / curl

3 points to say:

  1. The request still reaches the server.
  2. Complex requests send an OPTIONS preflight first.
  3. Real protection is authentication and authorization.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.