【发布时间】:2019-08-13 05:33:00
【问题描述】:
你好所以我正在使用获取 github api 的请求:
commitsPublic <- GET("https://<host-name>/api/v3/search/commits?
q=is:public+org:<ORG-NAME>",
add_headers(Authorization= "token <your-Token>", Accept=
'application/vnd.github.cloak-preview'))
commitsPublic
我得到:
156 项(总数)
Content-Type: application/json; charset=utf-8
Size: 291 kB
{
"total_count": 156,
"incomplete_results": false,
"items": [
{
(I removed the Items Since they are not important)
但是当我尝试转换 Json 时:
显示非结构化和可读的原始数据
jsonRespText<-content(commitsPublic,as="text")
jsonRespText
转换为 Json:
toJson <- fromJSON(jsonRespText)
toJson
返回:
$items[[30]]$score
[1] 1
它返回一个列表,其中包含最多 30 个项目" items[[30]]
并且 items[[31]] 为 NULL
所以我要问的是如何从 Json 文本中获取所有列表中的 156 个列出的项目。我有另一个获取请求,它给了我 10.000 Total Commits。但是当我从 Json 转换时,列表仍然有 30 个。所以任何帮助都将不胜感激!
【问题讨论】: