github_api.py 文件源码

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

项目:shrub 作者: Backgammon- 项目源码 文件源码
def edit_issue_comment(auth_token, username, repo, comment_id, comment_body, insecure=False):
    """
        Edits an existing comment on a specified issue.
    """
    # https://developer.github.com/v3/issues/comments/#edit-a-comment
    # Note: Issue Comments are ordered by ascending ID.
    # Parameters:
    # body - Reqired string. The contents of the comment.
    parameters = {"body": comment_body}

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

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

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


问题


面经


文章

微信
公众号

扫码关注公众号