Refactor common header constants and custom media type

This commit is contained in:
Wan Liuyang
2018-08-21 15:01:23 +08:00
parent ebcd3a52e3
commit ae5cdb285e
12 changed files with 82 additions and 30 deletions
+4 -3
View File
@@ -33,9 +33,10 @@
################################################################################
import github.GithubObject
import github.NamedUser
import Consts
class CommitComment(github.GithubObject.CompletableGithubObject):
"""
@@ -171,7 +172,7 @@ class CommitComment(github.GithubObject.CompletableGithubObject):
self._requester,
self.url + "/reactions",
None,
headers={'Accept': 'application/vnd.github.squirrel-girl-preview'}
headers={'Accept': Consts.mediaTypeReactionsPreview}
)
def create_reaction(self, reaction_type):
@@ -192,7 +193,7 @@ class CommitComment(github.GithubObject.CompletableGithubObject):
"POST",
self.url + "/reactions",
input=post_parameters,
headers={'Accept': 'application/vnd.github.squirrel-girl-preview'}
headers={'Accept': Consts.mediaTypeReactionsPreview}
)
return github.Reaction.Reaction(self._requester, headers, data, completed=True)