diff --git a/jobposting/views.py b/jobposting/views.py index df202f0..30d23e3 100644 --- a/jobposting/views.py +++ b/jobposting/views.py @@ -101,16 +101,16 @@ class GetAuthTokenView(APIView): credential = "{0}:{1}".format(client_id, client_secret) base64.b64encode(credential.encode("utf-8")) - headers = {'Content-Type': 'application/x-www-form-urlencoded', - 'Authorization': 'Basic '+credential, - 'Cache-Control': 'no-cache' - } - data = { - "grant_type": "client_credentials", - "client_id": client_id, - "client_secret": client_secret, - "redirect_uri": "http://izaac.izaac.pl/noexist/callback" + headers = { + "Authorization": f"Basic {credential}", + "Cache-Control": "no-cache", + "Content-Type": "application/x-www-form-urlencoded" } + data = { + "grant_type": "client_credentials" + } + print("DATA READY") - response = requests.post('http://izaac.izaac.pl/o/token/'+"grant_type=client_credentials", headers=headers) + response = requests.post('http://izaac.izaac.pl/o/token/', headers=headers, data=data) + print(response.text) return Response(response.json()) \ No newline at end of file