Rest API Codeigniter. CORS PROBLEM [SOLVED] |
Hello, I'm working on ReactJS. I'm using React for the front-end part of website, and as backend I'm using Codeigniter with the RestAPI library (https://github.com/chriskacerguis/codeig...restserver).
I'm working on http://localhost:8080 and PHP is on a link (created in hosts file) http://spotalefinale.com. Now, I've a controller: PHP Code: <?php and a sort of jquery ajax request: Code: handleSubmitLogin(e){ (axios works as $.ajax). I'm getting this error: "Failed to load http://spotalefinale.com/a: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access." but I enabled the cors in the controller, as you can see. Now if I enable the CORS with a Chrome extension, it works without any problem. (This is the extension). Which is the problem? Why without enabling the extension the cors doesn't work? Thank you if you have some ideas! |
Messages In This Thread |
Rest API Codeigniter. CORS PROBLEM [SOLVED] - by theedo - 04-15-2018, 11:26 AM
RE: Rest API Codeigniter. - by InsiteFX - 04-15-2018, 01:02 PM
RE: Rest API Codeigniter. - by theedo - 04-15-2018, 01:58 PM
RE: Rest API Codeigniter. - by InsiteFX - 04-15-2018, 02:04 PM
RE: Rest API Codeigniter. - by theedo - 04-15-2018, 02:19 PM
RE: Rest API Codeigniter. CORS PROBLEM [SOLVED] - by InsiteFX - 04-16-2018, 03:11 AM
|