![]() ![]() Now that we know what CORS is, let us go another step ahead. Depending on that the required headers has to be set on the server side. The server configuration for CORS has to be done keeping in mind how the data that is shared will be used. Having value as above tells the browser the request made from web page will only be allowed to get the data for the requested url. Having value * to the request URL header means it tells the browsers to allow requesting data from any origin to access the resource. The header of the browser should have details such as Access-Control-Allow-Origin which can have values as shown below − This step of permission is basically required for security reasons so that no webpage can make or get data from another domain without the required permission. This additional data is available in the browser header for the http request call made. ![]() In such case, there should be a permission from the requested url for accessing the data it means GET/PUT/POST/DELETE request made. When we make a http request to a different server than the host, we call it as cross origin request which means that either the domain, protocol, and port are different from the host origin. We make many http requests from the web page and for that we need to have CORS in place to get the data required. ![]() CORS is a process that needs extra HTTP header data to tell the browser whether the request made to the url by the web page running at say xyz.com origin should be given permission to access the data from the requested url. What is CORS?ĬORS stands for Cross Origin Resource Sharing. Before we dig deeper into the details, let us understand the basics of CORS and how it is useful. In this chapter, we will try to understand CORS in AMP. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |