import requests

    xml = """<?xml version="1.0" encoding="UTF-8"?>
    <PTZAux>
        <id>1</id>
    </PTZAux>"""

    request_url = f"http://some_domain.com/some_file"
    headers = {'Content-Type': 'application/xml'}
    response = requests.post(request_url, data=xml, headers=headers)
    if response.status_code == 200:
        print("Success: \n" + response.text)
    else:
        print("Error: " + response.status_code)
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *