var api;
(function() {
api = new FacePP('api_secret', 'api_key');
api.request('detection/detect', {
url:'http://apius.faceplusplus.com'
}, function(err, result) {
if (err) {
alert(err);
return;
}
// TODO use result
document.getElementById('response').innerHTML= JSON.stringify(result, null, 2);
});
})();
I am calling faceplusplus detection api using javascript.But when I run this code I can see error in browser console Cross-Origin Request Blocked and getting blank "" json response.Please suggest how can I fix it using above code. And also api is sending image downloading error. This code is using facepp-sdk.min.js. please help. Already there are some posts like How do I send a cross-domain POST request via JavaScript? But I am unable to figure out how will I merge my request in ths format.