Skip to content

Commit

Permalink
Set Accept header to application/json.
Browse files Browse the repository at this point in the history
Closes ask#59.
  • Loading branch information
JNRowe committed Aug 15, 2011
1 parent ef0cb80 commit 4486b7c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions github2/request.py
Expand Up @@ -131,7 +131,6 @@ def raw_request(self, url, extra_post_data, method="GET"):
scheme, netloc, path, query, fragment = urlsplit(url)
post_data = None
headers = self.http_headers
headers["Accept"] = "text/html"
method = method.upper()
if extra_post_data or method == "POST":
post_data = self.encode_authentication_data(extra_post_data)
Expand All @@ -154,5 +153,7 @@ def raw_request(self, url, extra_post_data, method="GET"):

@property
def http_headers(self):
return {"User-Agent": "pygithub2 v1",
"Accept-Encoding": "application/json"}
return {
"User-Agent": "pygithub2 v1",
"Accept": "application/json",
}

0 comments on commit 4486b7c

Please sign in to comment.