【问题标题】:Access Github private repo from Postman从 Postman 访问 Github 私人仓库
【发布时间】:2020-04-27 18:46:57
【问题描述】:

我正在尝试从邮递员访问我组织的 GitHub 私有仓库。

这就是我正在做的......

获取端点
https://api.github.com/repos/_orgs/_repo

标题
内容类型:应用程序/json

授权
OAUTH 2.0

我已从我的 github 帐户生成个人访问令牌,并将其作为令牌传递给 OAuth。

回应
状态码:404
{ “未找到信息”, "documentation_url": "https://developer.github.com/v3/repos/#get" }

任何建议/建议/想法都会有所帮助。

谢谢

更新

我试试这个建议

这里的密码是我的 github 令牌。 确保您没有与标头一起传递任何内容。成功了

【问题讨论】:

    标签: github


    【解决方案1】:

    我已从我的 github 帐户生成个人访问令牌,并将其作为令牌传递给 oAUTH。

    这取决于如何你通过它:如图in this issue,它必须是base64 encoded(例如base64encode.org

    OP 报告 curl 有效:

    curl -i -u myusername:mypersonaltoken https://api.github.com/repos/_orgs/_privaterepo
    

    从那里:

    将 cURL 命令导入 Postman。

    • 单击导入选项卡。
    • 选择原始文本选项并粘贴您的 cURL 命令。
    • 点击导入,您将在 Postman 构建器中获得该命令。

    【讨论】:

    • @ArslanAslam 你的意思是你有base64编码你的令牌?
    • @ArslanAslam 您是否在标题中添加了X-OAuth-Scopes 一个,如developer.github.com/apps/building-oauth-apps/… 所示?还有X-Accepted-OAuth-Scopes
    • 我在标题中添加了 X-Accepted-OAuth-Scopes : User。
    • 但我无法获得成功响应
    • @ArslanAslam 用户?它应该由用户(可能区分大小写)
    猜你喜欢
    • 1970-01-01
    • 2011-02-21
    • 2017-02-11
    • 2021-11-08
    • 2012-08-27
    • 2021-08-22
    • 2022-10-13
    • 2023-02-22
    • 1970-01-01
    相关资源
    最近更新 更多