3๐
โ
I found out that the method I was using was not valid for internal HTTPS requests. I used ifconfig to see the local ip-address, and used that instead of the host and put the ip-address in ALLOWED_HOSTS in settings.py. Furthermore, i disabled SSL verification with verify=False
def getDonations():
url = "https://172.19.10.5/api/donations"
payload = ""
headers = {
'cache-control': "no-cache",
}
response = requests.request("GET", url, data=payload, headers=headers, timeout=5, verify=False)
print(response.text)
return response.text
๐คgiggitygoat
0๐
Try Verifying the session
session = requests.Session()
session.verify = True
session.get("webpageUrl/api/donations", headers={'Content-Type':'application/json'}, timeout=5, verify=True)
๐คTom
Source:stackexchange.com