CkPython
CkPython
HTTP Post XML
Demonstrates how to POST XML to a website.Chilkat CkPython Downloads
import sys
import chilkat
success = False
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
http = chilkat.CkHttp()
# Make sure to replace the URL with something real...
url = "https://example.com/example.asp"
xmlBody = "<test>This is the XML to be sent</test>"
resp = chilkat.CkHttpResponse()
success = http.HttpStr("POST",url,xmlBody,"utf-8","application/xml",resp)
if (success == False):
print(http.lastErrorText())
sys.exit()
# Examine the body of the response.
print(resp.bodyStr())