Answer the question
In order to leave comments, you need to log in
How to get headers from http request?
All good.
Can't get headers. Outputs none.
What am I doing wrong?
def catch_all_get(path):
host = request.headers.get('host_addr')
key = request.headers.get('key')
secret = request.headers.get('secret')
print(host)
print(key)
print(secret)
url = create_url(path,host,key,secret)
try:
response = requests.get(url)
except:
print("ERROR")
finally:
print(url)
Answer the question
In order to leave comments, you need to log in
Since it displays None, then there are no headers, or throw the site, I'll check it myself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question