【问题标题】:How to retrieve a list of Github issues using Postman API如何使用 Postman API 检索 Github 问题列表
【发布时间】:2016-10-05 06:23:11
【问题描述】:

我正在使用 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"
}

【问题讨论】:

  • 它适用于我的用户令牌,但不适用于我设置的应用程序令牌

标签: api github postman


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2020-10-17
    • 1970-01-01
    • 2017-03-29
    • 1970-01-01
    • 2021-09-30
    • 2021-04-26
    • 2023-01-25
    • 2014-08-27
    相关资源
    最近更新 更多