【问题标题】:Editing GitHub Issues via API通过 API 编辑 GitHub 问题
【发布时间】:2019-02-12 17:50:39
【问题描述】:

我想使用 API 编辑 GitHub 问题的正文。我正在使用 Python 应用程序和请求库。

url = "https://GHE_server.company_name.com/api/v3/repos/org_name/repo_name/issues/1/"    
payload = {
      "title": "New title"
        }
    response = requests.patch(url, json=payload, headers={}, auth=(_USERNAME_, _TOKEN_), verify=_CA_CERT_)

我收到回复:

{'message': 'Not Found', 'documentation_url': 'https://developer.github.com/enterprise/2.13/v3'}

我查看了This Answer,这让我将有效负载更改为 =json 副数据。但我还是撞墙了。任何帮助将不胜感激。

【问题讨论】:

    标签: python python-requests github-api


    【解决方案1】:

    URL 中的尾部反斜杠导致访问无效页面。删除斜线解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2021-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-21
      • 2016-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多