Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

HTTP XMLRPC

See more HTTP Examples

Demonstrates an XML-RPC call to WordPress. WordPress ships with two test methods in its XML-RPC server, one of which is the "demo.sayHello" method. This example demonstrates sending the "demo.sayHello" XML-RPC request to Chilkat's cknotes.com Wordpress server.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cXmlReq
LOCAL oResp

nSuccess := 0

//  This example assumes the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

oHttp := CreateObject("Chilkat.Http")

cXmlReq := '<?xml version="1.0"?><methodCall><methodName>demo.sayHello</methodName><params /></methodCall>'

oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpStr("POST", "http://www.cknotes.com/xmlrpc.php", cXmlReq, "utf-8", "text/xml", oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp:destroy()
    RETURN
ENDIF

? oResp:BodyStr

oHttp:destroy()
oResp:destroy()