def http_post(url=None, request=None, lang='en-US', timeout=10, username=None, password=None):
    """

    Invoke an HTTP POST request 

    Parameters
    ----------

    - url: the URL of the server
    - request: the request message
    - lang: the language
    - timeout: timeout in seconds

    """

    if url is None:
        raise ValueError("URL required")

    u = urlsplit(url)

    headers = {
        'User-Agent'      : 'OWSLib (https://geopython.github.io/OWSLib)',
        'Content-type'    : 'text/xml',
        'Accept'          : 'text/xml',
        'Accept-Language' : lang,
        'Accept-Encoding' : 'gzip,deflate',
        'Host'            : u.netloc,
    }

    rkwargs = {}

    if username is not None and password is not None:
        rkwargs['auth'] = (username, password)

    up = requests.post(url, request, headers=headers, **rkwargs)
    return up.content
dataset/ETHPy150Open geopython/OWSLib/owslib/util.py/http_post/original