owslib.util.requests.request

Here are the examples of the python api owslib.util.requests.request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 Source : import_system.py
with Apache License 2.0
from CS-SI

def patch_owslib_requests(verify=True):
    """Overrides call to the :func:`requests.request` and :func:`requests.post` functions by
    :func:`owslib.util.openURL` and :func:`owslib.util.http_post` functions, providing some control over how to use
    these functions in `owslib   <  https://geopython.github.io/OWSLib/>`_.

    :param verify: (optional) Whether to verify the use of https or not
    :type verify: bool
    """
    from owslib.util import requests

    old_request = requests.request
    old_post = requests.post
    try:
        requests.request = partial(requests.request, verify=verify)
        requests.post = partial(requests.post, verify=verify)
        yield
    finally:
        requests.request = old_request
        requests.post = old_post