Reputation: 1
If I paste the following Url into Safari:
-> I get a 200 response and a stream with the text of "error=incorrect_client_credentials", which is what I expect.
If I run the following Node.js code (which I wrote to do the same thing), I get a 400 response and an error page. I can't figure out what can go wrong... Please help...
var options = {
hostname: 'github.com',
port: 443,
path: 'login/oauth/access_token?client_id=abf35093bb766b063810&client_secret=XYZ&code=XYZ',
method: 'GET',
headers: {'user-agent': 'node.js'},
Accept: '*/*'
};
var req = https.request(options, function(res) {
res.setEncoding('utf-8');
var responseString = '';
res.on('data', function(data) {
responseString += data;
});
res.on('end', function() {
console.log(responseString);
console.log('Response ' + res.statusCode);
});
});
req.end();
Upvotes: 0
Views: 72
Reputation: 1
OK, got to the bottom of it.
2 errors:
It's working now...
Upvotes: 0