Learn Android for Free,issues for developers, mobengineers website provide complete solutions for developers issues posts.It also provides online training for android development

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
});

20% off

Online Training

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

NDTV Gadgets360

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts