![]() Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. This screencast shows how to fix the problem with custom middleware (made with Artisan helper) to set additional headers like Access-Control-Allow-Origin and Acess-Control-Allow-Header on each request for a. While this code snippet may be the solution, including an explanation really helps to improve the quality of your post. ![]() Also if this does not work try restarting the AWS server, or try running the hosted application on a different machine. ![]() My EventService. 1 Answer Sorted by: 0 Can you try going incognito and trying Might be a caching issue since you are working on the same machine. Header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE") Īnd vue login method (' this. Instead, youll often be met with the dreaded No Access-Control-Allow-Origin header is present on the requested resource response. I have tried a few different things such as adding in the Access-Control headers, setting the credentials to true, and trying this on the 127.0.0.1 address as opposed to localhost but still not having any luck. I have been try like this on front-end (main.js) = 'application/x-= '*' Īnd this on backend (controller) header('Access-Control-Allow-Origin: *') Request header field access-control-allow-origin is not allowedīy Access-Control-Allow-Headers in preflight response. I build an app use vue and codeigniter, but I have a problem when I try to get api, I got this error on console Access to XMLHttpRequest at ' from origin ' has been blocked by CORS policy:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |