Response
HTTP Access-Control-Allow-Origin Header
Part of the CORS (Cross-Origin Resource Sharing) system. Indicates whether the response can be shared with requesting code from a different origin.
Purpose
Controls which websites can access the API from browser-based applications, preventing unauthorized cross-origin requests.
Access-Control-Allow-Origin: * Access-Control-Allow-Origin: https://example.com Access-Control-Allow-Origin: null
CORS is a browser security mechanism. Server-to-server requests are not restricted by CORS.
Code Examples
See how to use the Access-Control-Allow-Origin header in different tools and languages.
Related Headers
Test Your APIs
cors headerhttp corshttp headers guide