在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jviotti/ghrequest开源软件地址:https://github.com/jviotti/ghrequest开源编程语言:JavaScript 100.0%开源软件介绍:ghrequestGitHub API HTTP client with cache support to get the most of your rate limit. DescriptionThis module provides a configured instance of the popular request module to work more efficientely with the public GitHub API. Notice that streaming is not supported by this module. The problemGitHub allows a maximum of 5000 requests per hour for authenticated requests and 60 requests per hour for non authenticated requests. This default rate limiting might not be enough to meet the needs of an application that intensively communicates with the GitHub API. See Rate Limiting for more details. The solutionIf a GitHub API response contains either an See Conditional Requests for more details. This is handled for you automatically so you don't have to bother messing with HTTP headers yourself. InstallationInstall $ npm install --save ghrequest DefaultsThis module includes the following modifications to
Make sure you check the request documentation to understand what the mentioned options do in greater detail. Notice that all mentioned modifications are overwritable. User AgentYou MUST include a For example: ghrequest({
url: '/foo',
headers: {
'User-Agent': 'My Cool App'
}
}, function(error, response, body) {
if (error) throw error;
console.log(body);
}); Documentationghrequest(options, callback)See request for more details about how to use this function. Kind: global function
Example // Anonymous Request
ghrequest({
method: 'GET',
url: '/repos/angular/angular/issues'
}, function(error, response, body) {
if (error) throw error;
console.log(body);
}); Example // Basic Authentication
ghrequest({
method: 'GET',
url: '/repos/angular/angular/issues',
auth: {
user: 'johndoe',
pass: 'secret'
}
}, function(error, response, body) {
if (error) throw error;
console.log(body);
}); SupportIf you're having any problem, please raise an issue on GitHub and I'll be happy to help. TestsRun the test suite by doing: $ gulp test Contribute
Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning: $ gulp lint LicenseThe project is licensed under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论