I'm very new so apologies if I use the wrong terminology. I am trying to pull data using Trello API but receive the following error in Chrome console:
Failed to load https://api.trello.com/1/cards/5a42e19364345a7d84ba3f5f/members: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
After doing some research I have found this is a CORS problem. I am using Google App Engine with Python. Is this error something I can fix or is it a bug with the API? I have managed to do a POST request using this API no problem. I have read lots of information about CORS but haven't found a solution to the problem.
Here is my Javascript code for the GET request, it is just copy/pasted from the Trello API so I'm not sure what's wrong:
var authenticationSuccess = function() {
console.log('Successful authentication');
};
var authenticationFailure = function() {
console.log('Failed authentication');
};
window.Trello.authorize({
type: 'popup',
name: 'Work Requests App',
scope: {
read: 'true',
write: 'true' },
expiration: 'never',
success: authenticationSuccess,
error: authenticationFailure
});
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.trello.com/1/cards/5a42e1936434a7d84ba3f5f/members");
xhr.send(data);