🔐Cross-Origin Resource Sharing (CORS)
Also known as CORS, CORS Error, Access-Control-Allow-Origin
A browser rule. It decides if a page on one site may read another site's data.
Think of it like
Think of it like a guest list. The server says which other sites may come in and ask for data.
Example
Why it matters
Definition
Example code
http
HTTP/1.1 200 OK
Access-Control-Allow-Origin: https://shop.example.comCommon mistake
Key takeaways
- 1A browser rule. Tools like curl ignore it.
- 2The server decides. With a header.
- 3Name the sites. Avoid the star.