I have written a python script to validate url connectivity from a host. What is reporting successful (http 200) in linux curl
is reported as a 403 in the python (3.6) requests
module.
I'm hoping someone can help me understand the differences here in reported http status codes?
Curl from the Linux command line....
$ curl -ILs https://www.h2o.ai|egrep ^HTTP
HTTP/1.1 200 OK
Python requests module.....
>>> import requests
>>> url = 'https://www.h2o.ai'
>>> r = requests.get(url, verify=True, timeout=3)
>>> r.status_code
403
>>> requests.packages.urllib3.disable_warnings()
>>> r = requests.get(url, verify=False, timeout=3)
>>> r.status_code
403