【发布时间】:2019-03-21 09:17:56
【问题描述】:
嘿,所以我在 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”参数传递,但是它说它缺少的代码是什么?
【问题讨论】:
-
?=org:看起来很可疑,查询参数有key=value语法。 -
我在这里看到了:help.github.com/en/articles/searching-commits 它说 Qualifier 可以。组织:ORGNAME
-
这将是查询参数
q的值 的一部分,并且冒号应该是URL 转义的。请参阅这些文档中的示例:https://github.com/search?utf8=%E2%9C%93&q=test+org%3Agithub&type=Commits。 -
是的,但是如何在 R 中对其进行语法处理?从我的特定组织的所有存储库中获取所有提交。
-
...
?q=org%3A<org-Name>?