Skip to content

Commit 4486b7c

Browse files
committed
Set Accept header to application/json.
Closes ask#59.
1 parent ef0cb80 commit 4486b7c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

github2/request.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ def raw_request(self, url, extra_post_data, method="GET"):
131131
scheme, netloc, path, query, fragment = urlsplit(url)
132132
post_data = None
133133
headers = self.http_headers
134-
headers["Accept"] = "text/html"
135134
method = method.upper()
136135
if extra_post_data or method == "POST":
137136
post_data = self.encode_authentication_data(extra_post_data)
@@ -154,5 +153,7 @@ def raw_request(self, url, extra_post_data, method="GET"):
154153

155154
@property
156155
def http_headers(self):
157-
return {"User-Agent": "pygithub2 v1",
158-
"Accept-Encoding": "application/json"}
156+
return {
157+
"User-Agent": "pygithub2 v1",
158+
"Accept": "application/json",
159+
}

0 commit comments

Comments
 (0)