(PureBasic) HTTP XMLRPC
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.
IncludeFile "CkHttp.pb"
Procedure ChilkatExample()
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
http.i = CkHttp::ckCreate()
If http.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
xmlReq.s = "<?xml version=" + Chr(34) + "1.0" + Chr(34) + "?><methodCall><methodName>demo.sayHello</methodName><params /></methodCall>"
xmlResponse.s = CkHttp::ckXmlRpc(http,"http://www.cknotes.com/xmlrpc.php",xmlReq)
If CkHttp::ckLastMethodSuccess(http) <> 1
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
ProcedureReturn
EndIf
Debug xmlResponse
CkHttp::ckDispose(http)
ProcedureReturn
EndProcedure
|