Sample code for 30+ languages & platforms
Visual FoxPro

HTTP Post XML

Demonstrates how to POST XML to a website.

Chilkat Visual FoxPro Downloads

Visual FoxPro
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