0
在documentation of the Github API之后创建NodeJS应用程序的授权。408请求Github API的NodeJS应用程序超时
我有以下代码:
var _options = {
headers: {
'User-Agent': app.get('ORGANISATION')
},
hostname: 'api.github.com'
};
var oauth2Authorize = function() {
var path = '/authorizations?scopes=repo';
path += '&client_id='+ app.get('GITHUB_CLIENT_ID');
path += '&client_secret='+ app.get('GITHUB_CLIENT_SECRET');
path += '¬e=ReviewerAssistant';
_options.path = path;
_options.method = 'POST';
var request = https.request(_options, function (response) {
var data = "";
response.on('data', function (chunk) {
data += chunk;
});
response.on('end', function() {
console.log(data);
});
});
request.on('error', function (error) {
console.log('Problem with request: '+ error);
});
};
和所有我得到的是:
408 Request Time-out
Your browser didn't send a complete request in time.
做一个GET
要求工作虽然。
我是个白痴。我在2周前阅读了这篇文章,并且忘记了......谢谢! –