← Back to headers
HTTP Header
Access-Control-Allow-Origin
CORSSpecifies which origin is allowed to access the resource in cross-origin requests.
HTTP header reference, syntax, examples, and developer usage.
What is the Access-Control-Allow-Origin header?
The Access-Control-Allow-Origin HTTP header is used to transmit metadata between a client and server as part of HTTP requests or responses.
HTTP headers define how content should be interpreted, cached, authenticated, secured, or processed by browsers and APIs.
Direction
This header may appear in both HTTP requests and responses.
Syntax
Access-Control-Allow-Origin: <origin> | *
Example
Access-Control-Allow-Origin: https://app.example.com
Common use cases
- CORS configuration
- Allowing frontend apps to call APIs
- Cross-origin resource sharing
Common mistakes
- Using the header in the wrong request or response context
- Sending invalid header values
- Incorrect header syntax
- Assuming the header automatically changes server behaviour