(VBScript) HTTP Post XML
Demonstrates how to POST XML to a website. Note: This example requires Chilkat v11.0.0 or greater.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
success = 0
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
set http = CreateObject("Chilkat.Http")
' 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>"
set resp = CreateObject("Chilkat.HttpResponse")
success = http.HttpStr("POST",url,xmlBody,"utf-8","application/xml",resp)
If (success = 0) Then
outFile.WriteLine(http.LastErrorText)
WScript.Quit
End If
' Examine the body of the response.
outFile.WriteLine(resp.BodyStr)
outFile.Close
|