function xmlrpc_request

Constructs an object representing an XML-RPC request.

Parameters

$method: The name of the method to be called.

$args: An array of parameters to send with the method.

Return value

object An XML-RPC object representing the request.

1 call to xmlrpc_request()
_xmlrpc in includes/xmlrpc.inc
Performs one or more XML-RPC requests.

File

includes/xmlrpc.inc, line 403

Code

function xmlrpc_request($method, $args) {
    $xmlrpc_request = new stdClass();
    $xmlrpc_request->method = $method;
    $xmlrpc_request->args = $args;
    $xmlrpc_request->xml = <<<EOD
<?xml version="1.0"?>
<methodCall>
<methodName>{<span class="php-variable">$xmlrpc_request</span>-&gt;<span class="php-function-or-constant property member-of-variable">method</span>}</methodName>
<params>

EOD;
    foreach ($xmlrpc_request->args as $arg) {
        $xmlrpc_request->xml .= '<param><value>';
        $v = xmlrpc_value($arg);
        $xmlrpc_request->xml .= xmlrpc_value_get_xml($v);
        $xmlrpc_request->xml .= "</value></param>\n";
    }
    $xmlrpc_request->xml .= '</params></methodCall>';
    return $xmlrpc_request;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.