Skip to content

Commit cb65d88

Browse files
authored
Merge pull request #3 from hosseinamin/patch-1
Specify urlencoded Content-Type
2 parents a6d83a8 + 17f11a0 commit cb65d88

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

instagram/oauth2.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def exchange_for_access_token(self, code=None, username=None, password=None, sco
109109
data = self._data_for_exchange(code, username, password, scope=scope, user_id=user_id)
110110
http_object = Http(disable_ssl_certificate_validation=True)
111111
url = self.api.access_token_url
112-
response, content = http_object.request(url, method="POST", body=data)
112+
headers={"Content-Type":"application/x-www-form-urlencoded"}
113+
response, content = http_object.request(url, method="POST", body=data, headers=headers)
113114
parsed_content = simplejson.loads(content.decode())
114115
if int(response['status']) != 200:
115116
raise OAuth2AuthExchangeError(parsed_content.get("error_message", ""))

0 commit comments

Comments
 (0)