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
@@ -34,9 +34,10 @@
################################################################################
import github.GithubObject
import github.NamedUser
import Consts
class IssueComment(github.GithubObject.CompletableGithubObject):
"""
@@ -148,7 +149,7 @@ class IssueComment(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):
@@ -169,7 +170,7 @@ class IssueComment(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)