Hello,
Have a server code script that's working great, but when I try to use it to access a 3rd party API, I get a "502 Bad Gateway" error.
Not sure who's end the error is on.
Is what I'm attempting even possible? If so, what might be causing it?
Hello,
Have a server code script that's working great, but when I try to use it to access a 3rd party API, I get a "502 Bad Gateway" error.
Not sure who's end the error is on.
Is what I'm attempting even possible? If so, what might be causing it?
Bi Beej,
Please specify: do you can access your 3rd party api via other tools?(like postman https://chrome.google.com/webstore/de...)
In general it seems to be problem with your 3rd party api server.
Also see about 502 error here
http://www.checkupdown.com/status/E50...
Regards.
It's likely an issue with the 3rd party library (Evernote SDK). It probably doesn't send the ajax request properly.
Speaking of which, I have another one right now. The only way it works in Postman is to send it in raw JSON format. Is there any way to get this to work in Server Code? Cannot get any version of "XHR.send" to work.
Hi Beej,
Please provide us settings for Postman, which is you use for correct response(use text and screen shots).
We will take a look and will try to provide a solution for you.
Regards.
Actually, just got it to work by putting the JSON object in the body (thanks!):
prevar url = 'https://mydomain.auth0.com/oauth/token';
var postData = {
"parameters": {},
"headers": {
"Content-Type": "application/json"
},
"body": {
"client_id": "GU...Pa",
"client_secret": "Wr...JM",
"grant_type": "client_credentials"
}
};
XHRResponse = XHR.send('POST', url, postData);
/pre
Hello Beej,
Thank you for the update, glad it works!