嘿,所以我在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...
...
它说代码丢失 在get请求中,我必须对查询语法进行语法处理,在该查询中,我将组织名称传递为“ q”参数,但是该代码缺少什么代码?
答案 0 :(得分:0)
我找到了解决方法:
基本上在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'))