(Visual FoxPro) HTTP Post XML
Demonstrates how to POST XML to a website. Note: This example requires Chilkat v11.0.0 or greater.
LOCAL lnSuccess
LOCAL loHttp
LOCAL lcUrl
LOCAL lcXmlBody
LOCAL loResp
lnSuccess = 0
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
loHttp = CreateObject('Chilkat.Http')
* Make sure to replace the URL with something real...
lcUrl = "https://example.com/example.asp"
lcXmlBody = "<test>This is the XML to be sent</test>"
loResp = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpStr("POST",lcUrl,lcXmlBody,"utf-8","application/xml",loResp)
IF (lnSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loResp
CANCEL
ENDIF
* Examine the body of the response.
? loResp.BodyStr
RELEASE loHttp
RELEASE loResp
|