github_api.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:shrub 作者: Backgammon- 项目源码 文件源码
def edit_issue(auth_token, username, repo, issue_number, issue_title, issue_body, insecure=False):
    """
        Edit an issue.
    """
    # https://developer.github.com/v3/issues/#edit-an-issue
    # Parameters (not required):
    # title - String containing the title of the issue.
    # body - String containing the body of the issue.
    parameters = {"title": issue_title, "body": issue_body}

    try:
        response = requests.patch("https://api.github.com/repos/{}/issues/{}".format(repo, issue_number),
                            json=parameters,
                            headers=auth_header(auth_token))
    except requests.SSLError:
        print("A network error occurred.")

        if insecure:
            print("An SSL certificate error occurred.")

    return response.json()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号