[Solved] CORS problems and No Access-Control-Allow-Origin header errors with Ionic

Published: 29 November 2018
on channel: Coder Jay
11,624
43

Fixed CORS problems and No Access-Control-Allow-Origin header errors with Ionic.

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

Add these 4 line codes in your header of the PHP file.

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST ,OPTIONS, PUT');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json');

If Still issue comes then you need to use Advanced Http Cordova Plugin
https://ionicframework.com/docs/nativ...

🔥 TMD Hosting Affiliate
Get 40% OFF on Website Hosting and other Plans https://mywebhostguru.com/tmdhosting

🔥 DIGITAL OCEAN HOSTING Offer
Get $200 in credit for 60 days https://m.do.co/c/8e44c23bdd22

🔥 Hostinger Hosting Offers
https://bit.ly/3GlVbLB

Stay Connected With Us:
Website: https://mywebhostguru.com/
Facebook:   / webhostguru  
  / mauryavijay91  

#cors


Watch video [Solved] CORS problems and No Access-Control-Allow-Origin header errors with Ionic online without registration, duration hours minute second in high quality. This video was added by user Coder Jay 29 November 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11,624 once and liked it 43 people.