Can't send a post using RPC XML
-
Hi,
i’m using a code to post a new post with rpc xml
when i put some texte (8 lines) in body the script doesn’t work and no post added
but when i put just some words in body the post is created
so is there any limit to the amount of texte that we can send in post body when using rpc xml ??
the code i’m using :
function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords=’tag’,$encoding=’UTF-8′) {
$login = $username;
$mdp = $password;
$rpc = $rpcurl;$category = array(1);
$category = implode( ‘,’, $category);$titre = $title;
$article = $body;
$XML = “<category>”.$category.”</category><title>”.$titre.”</title>”.$article;
$param = array( ”,” ,$login,$mdp,$XML,1);
$req = xmlrpc_encode_request(‘blogger.newPost’,$param);$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_URL, $rpc);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
$res=curl_exec($ch);
curl_close($ch);return $res;
}
The topic ‘Can't send a post using RPC XML’ is closed to new replies.