diff --git a/instagram/oauth2.py b/instagram/oauth2.py index 053b1be8..002032a4 100644 --- a/instagram/oauth2.py +++ b/instagram/oauth2.py @@ -109,7 +109,8 @@ def exchange_for_access_token(self, code=None, username=None, password=None, sco data = self._data_for_exchange(code, username, password, scope=scope, user_id=user_id) http_object = Http(disable_ssl_certificate_validation=True) url = self.api.access_token_url - response, content = http_object.request(url, method="POST", body=data) + headers={"Content-Type":"application/x-www-form-urlencoded"} + response, content = http_object.request(url, method="POST", body=data, headers=headers) parsed_content = simplejson.loads(content.decode()) if int(response['status']) != 200: raise OAuth2AuthExchangeError(parsed_content.get("error_message", ""))