Hi,
I’m connecting to the meetup OAUTH2 API using a fetch call from by backend.jsw module (moved from client side due to a CORS error). However when I execute the POST request using this fetch I get a 400 Bad Request error. The request works fine from Postman and native browser, but not from the back end code:
export function connectToMeetup( code ){
let url = 'https://secure.meetup.com/oauth2/access?' +
'client_id=yyy&' +
'client_secret=xxx&' +
'grant_type=authorization_code&' +
'code=' + code;
return fetch(url, {method: 'get'}).then( (response) => {
if (response.ok) {
return response.json();
}
else {
return Promise.reject("Failed to authorise. Error = " + response.status + "-" + response.statusText);
}
}).then( (json) => {
return json.toString();
}).catch( (err) => {
return 'ERROR:' + err;
});
}
Any ideas?
Thanks,
Gary