Forum Moderators: coopster
I'm trying to change a script I've written to be used on a host that does not support the xmlrpc_encode_request function.
I use the function only once in my script, and only because a tutorial I was following had used it. My use is to prepare a few lines of content to be posted by curl.
curl_setopt($ch,CURLOPT_POSTFIELDS,xmlrpc_encode_request("blogger.newPost",array("","","username","password","<title>Title</title><category>Category 1,Category 2</category>Description of the post.",1)));
Is there something else I can use to prepare the text? Maybe using whatever the text output of the function as a template, and using that text instead?
I tried using XML-RPC for PHP but it didn't seem to work for me, and the multi megabyte files seemed overkill for my needs.
If it matters, I'm using this for a script in wordpress.
Thanks for any help.
curl_setopt($ch,CURLOPT_POSTFIELDS,xmlrpc_encode_request("blogger.newPost",array("","","username","password","<title>Title</title><category>Category 1,Category 2</category>Description of the post.",1)));
Seems equivalent to:
curl_setopt($ch,CURLOPT_POSTFIELDS,"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><methodCall><methodName>blogger.newPost</methodName><params>
<param><value><string/></value></param>
<param><value><string/></value></param>
<param><value><string>username</string></value></param>
<param><value><string>password</string></value></param>
<param><value><string><title>Title</title><category>Category 1,Category 2</category>Description of the post.</string></value></param>
<param><value><int>1</int></value></param>
</params></methodCall>");