如何使用Postman API检索Github问题列表

时间:2016-10-04 22:09:23

标签: api github postman

我正在使用Postman测试从我的Github中提取问题列表

在命令行中,我可以执行以下操作

curl -i -H 'Authorization: token <mytoken>' \
    https://api.github.com/user/issues

我认为它返回一个空块:

HTTP/1.1 200 OK
Server: GitHub.com
Date: Tue, 04 Oct 2016 22:01:26 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 5
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4988
X-RateLimit-Reset: 1475621615
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "db74aad51113746c20473c4cf2b08bde"
X-OAuth-Scopes: gist, notifications, repo, user
X-Accepted-OAuth-Scopes:
X-GitHub-Media-Type: github.v3
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding
X-Served-By: cee4c0729c8e9147e7abcb45b9d69689
X-GitHub-Request-Id: 520E2ADF:3E4D:3650D52:57F426B6

[

]

所以我在Postman中测试它,但是虽然我可以做一个简单的令牌GET请求,但我在Postman中得到以下内容

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3"
}

1 个答案:

答案 0 :(得分:0)

我错过了添加我设置的应用程序令牌的范围

https://developer.github.com/v3/oauth/