I get Cross-Origin Request Blocked:
error on requesting with the below code.
$.ajax({
url: 'https://www.google.com/m8/feeds/contacts/default/full?access_token=' + token.access_token,
type: 'POST',
crossOrigin: true,
crossDomain: true,
Origin: 'http://localhost',
Host: 'www.google.com',
xhrFields: {
withCredentials: true
},
dataType: 'xml',
'Gdata-version': '3.0',
'Content-Type': 'application/atom+xml',
'body': xml,
}).done(function(data) {
console.log(data);
});
});
GET
method retrieves contacts with jsonp(not for POST
method) as datatype without any error but in POST
method I get errors.