Access to XMLHttpRequest has been blocked by CORS policy

There are two ways this can be handled:

  1. Temporary Front-End solution so you can test if your API integration is working:

Click on window -> type run and hit enter -> in the command window copy:

chrome.exe –user-data-dir=”C://Chrome dev session” –disable-web-security

This will open a new “Chrome” window where you can work easily. This is a temporary solution. Every time you will have to work with this chrome window.

  1. Permanent solution:

In the backend code, the developer needs to add an annotation @Crossorigin right above the CRUD api call method.

Let me know if it works.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)