From 50d26ba2d02eee51880b0b1bc1cc7ea1f51b91aa Mon Sep 17 00:00:00 2001 From: Jakub K Date: Mon, 22 Jan 2024 22:52:03 +0100 Subject: [PATCH] degubowanie --- jobposting/views.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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