We provide complete mobile and web apps development solutions

Thursday, January 12, 2017

CORS is if your trying to access from one domain - another domain.

XMLHttpRequest cannot load https://www.test.com;.
 No 'Access-Control-Allow-Origin' header is present
 on the requested resource. Origin 'http://127.0.0.1:55427'
 is therefore not allowed access.
CORS is if your trying to access from one domain  - another domain.
Try withJSONP. JSONP should work , because it  uses the GET method.
Try this
var url = "https://test.com";
$http({
    method: 'JSONP',
    url: url
}).
success(function(status) {
    //success
}).
error(function(status) {
    //fails
});

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts