Skip to content

Commit

Permalink
Fix POST requests to send json data (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Dec 22, 2021
1 parent d87fa2e commit 731d25e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fyle_rest_auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def post_request(url, body, access_token: str = None, origin_address: str = None
response = requests.post(
url,
headers=api_headers,
data=body
data=json.dumps(body)
)

if response.status_code == 200:
Expand Down Expand Up @@ -74,7 +74,7 @@ def generate_fyle_refresh_token(self, authorization_code: str) -> Dict:
'code': authorization_code
}

return self.post(url=self.token_url, body=api_data)
return post_request(url=self.token_url, body=api_data)

def refresh_access_token(self, refresh_token: str) -> Dict:
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-rest-auth',
version='1.0.0',
version='1.0.1',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to implement OAuth 2.0 using Fyle in Django rest framework',
Expand Down

0 comments on commit 731d25e

Please sign in to comment.