Open In App

HTTP headers | Access-Control-Allow-Origin

The Access-Control-Allow-Origin is a response header that is used to indicates whether the response can be shared with requesting code from the given origin.

Syntax:



Access-Control-Allow-Origin: * | <origin> | null

Directives: Access-Control-Allow-Origin accepts there types of directives mentioned above and described below:

Example:



To check this Access-Control-Allow-Origin in action go to Inspect Element -> Network check the response header for Access-Control-Allow-Origin like below, Access-Control-Allow-Origin is highlighted you can see.


Supported browsers: The browsers compatible with HTTP headers Access-Control-Allow-Origin are listed below:

Article Tags :