You need to remember to encode your xml body to utf-8, otherwise the requests module will throw in weird exceptions like this: 2018-05-04 16:53:57,068 ERROR:'NoneType' object is not callable
2018-05-04 16:54:21,816 ERROR:too many values to unpack (expected 2)
2018-05-04 17:22:20,238 ERROR:'NoneType' object is not callable
2018-05-04 17:39:07,737 ERROR:'NoneType' object is not callable
2018-05-04 17:42:03,475 ERROR:'NoneType' object is not callable
2018-05-04 17:45:56,628 ERROR:'NoneType' object is not callable
Do not use prettify() as the xml body, using prettify() method will cause \n to be added on every line, tufin SC will complain about workflow not found or anything not found.
You need to post like this:
try: response = tufin_sc.post(TUFIN_BASE + TICKET_URI, data=base_content.encode('utf-8')) print(response.text) except Exception as e: logging.error(e) exit(1)