I am successfully able to send an HTTP GET request using Python 3.9. However, when attempting the same request using Django 4.2 and Python 3.10, it fails to work as expected.
import requests
headersa = {
'accept': 'text/plain',
'x-api-key': 'pgH7QzFHJx4w46fI~5Uzi4RvtTwlEXp'
}
url = "https://10.11.11.66:1003/config/v6/servers"
try:
response = requests.get(url=url, headers=headersa, verify=False, timeout=50)
print(response.text)
except requests.exceptions.RequestException as e:
print("An error occurred:", e)
When I use Python 3.9, I am able to send an HTTP GET request without any issues, and it functions correctly. However, when I attempt to send the same HTTP GET request within the context of a Django 4.2 project using Python 3.10, I encounter errors or unexpected behavior.