Python requests.packages.urllib3.exceptions.InsecurePlatformWarning() Examples
The following are 3
code examples of requests.packages.urllib3.exceptions.InsecurePlatformWarning().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
requests.packages.urllib3.exceptions
, or try the search function
.
Example #1
Source File: http.py From omnibus with MIT License | 6 votes |
def post(*args, **kwargs): kwargs['verify'] = False with warnings.catch_warnings(): warnings.simplefilter('ignore', exceptions.InsecureRequestWarning) warnings.simplefilter('ignore', exceptions.InsecurePlatformWarning) # if isinstance(self.proxy, dict): # kwargs['proxies'] = self.proxy try: req = requests.post(*args, **kwargs) except: return (False, None) if req.status_code == 200: return (True, req) else: return (False, req)
Example #2
Source File: http.py From omnibus with MIT License | 6 votes |
def get(*args, **kwargs): kwargs['verify'] = False with warnings.catch_warnings(): warnings.simplefilter('ignore', exceptions.InsecureRequestWarning) warnings.simplefilter('ignore', exceptions.InsecurePlatformWarning) # if isinstance(self.proxy, dict): # kwargs['proxies'] = self.proxy try: req = requests.get(*args, **kwargs) except: return (False, None) if req.status_code == 200: return (True, req) else: return (False, req)
Example #3
Source File: IgnoreWarnings.py From AmazonRobot with MIT License | 5 votes |
def ignore_warnings(): requests.packages.urllib3.disable_warnings(InsecureRequestWarning) requests.packages.urllib3.disable_warnings(SubjectAltNameWarning) requests.packages.urllib3.disable_warnings(InsecurePlatformWarning) requests.packages.urllib3.disable_warnings(SNIMissingWarning)