Python/requests

From Omnia
Jump to navigation Jump to search

requests

import requests
requests.post(url='https://foo.example', data={'bar':'baz'})

Ignore SSL

requests.get('https://bad-ssl.com', verify=False)

Turn off all warning messages:

import requests
requests.urllib3.disable_warnings()

As of Python 3.6+ can turn off the specific warning message too:

import warnings
warnings.filterwarnings("ignore", message="Unverified HTTPS request")

ref: https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-python-requests