(VBScript) HTTP Post XML
Demonstrates how to POST XML to a website.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
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>"
' resp is a Chilkat.HttpResponse
Set resp = http.PostXml(url,xmlBody,"utf-8")
If (http.LastMethodSuccess = 0) Then
outFile.WriteLine(http.LastErrorText)
Else
' Examine the body of the response.
outFile.WriteLine(resp.BodyStr)
End If
outFile.Close
|