degubowanie
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Jakub K 2024-01-22 22:52:03 +01:00
parent c9dde8d76b
commit 50d26ba2d0

View File

@ -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())