Python Requests Get: "dynamic Backend Host Not Specified"
I am trying to do a very simple https 'get' method using python's requests package, and it seems to work, except that I get an error message from the host machine saying: 'Dynamic
Solution 1:
Okay, it turns out that it's a matter of setting up the headers correctly.
Adding
headers = {'content-type': 'application/json', 'accept':'application/json'}
fixed the problem.
The code for the working call:
r = requests.post(
HELLO_WORLD_URL,
cert = (os.path.join(CERT_DIR, "cert.pem"), os.path.join(CERT_DIR, "example-key.pem")),
auth = (USER_ID, PASSWORD),
headers = {'content-type': 'application/json', 'accept':'application/json'})
Post a Comment for "Python Requests Get: "dynamic Backend Host Not Specified""