r - 使用 R 从 Github 中组织的所有存储库中获取所有 COMMITS
问题描述
嘿,所以我在 R 中使用这一行:
request <- GET("https://<host-name>/api/v3/search/commits?=org:<org-Name>",
add_headers(Authorization= "token <token number>",
Accept= 'application/vnd.github.cloak-preview'))
结果我得到了这个:
]
Date: 2019-03-21 09:13
Status: 422
Content-Type: application/json; charset=utf-8
Size: 221 B
{
"message": "Validation Failed",
"errors": [
{
"resource": "Search",
"field": "q",
"code": "missing"
}
],
"documentation_url": "https://developer.github.com/enterprise/2...
...
它说缺少代码在获取请求中,我必须编写一个查询语法,其中我将组织名称作为“q”参数传递,但是它说它缺少的代码是什么?
解决方案
我找到了一个解决方案:
commits?
基本上应该在前面,commits?q=
但这也不起作用,因为它需要一个字符串字段,所以:commits?q=stringfield+org:{org-name}
request <- GET("https://<host-name>/api/v3/search/commits?=org:<org-Name>",
add_headers(Authorization= "token <token number>",
Accept= 'application/vnd.github.cloak-preview'))
推荐阅读
- python - Flask 到 Django 的转换,flask.url_for,flask.request.url
- flutter - 如何将 woocommerce 集成到 Flutter 应用程序中
- javascript - 通过 JavaScript 或 JQuery 对数组进行排序
- node.js - GraphQL 网关`预检请求未通过访问控制检查`
- discord - 创建不和谐频道的成绩单
- django - 创建带有两个参数的站点地图类返回 URL
- node.js - 如何使用以美元符号开头的字符串值更新 mongodb 中的字段
- android - 我们如何在 firebase(android、kotlin)中记录错误?
- division - LC-3 中的除法运算,结果是实数(不是整数)
- java - 如何重复输入直到在java中获得正确的语句?