(C) 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.
#include <C_CkHttp.h>
void ChilkatSample(void)
{
HCkHttp http;
const char *xmlReq;
const char *xmlResponse;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
xmlReq = "<?xml version=\"1.0\"?><methodCall><methodName>demo.sayHello</methodName><params /></methodCall>";
xmlResponse = CkHttp_xmlRpc(http,"http://www.cknotes.com/xmlrpc.php",xmlReq);
if (CkHttp_getLastMethodSuccess(http) != TRUE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
return;
}
printf("%s\n",xmlResponse);
CkHttp_Dispose(http);
}
|