尝试通过包含@ -sign的PHP和cURL发送文本,消息无法传递,并且没有错误消息。 可能是什么原因?
PHP代码:
$postMessage = '@hello world lorem ipsum dolor';
$authToken = "12345";
$postData = array(
'kind' => 'blogger#post',
'blog' => array('id' => $blogID),
'title' => $postTitle,
'content' => $postMessage
);
$ch = curl_init('https://www.googleapis.com/blogger/v3/blogs/'.$blogID.'/posts/');
curl_setopt_array($ch, array(
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer '.$authToken,
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => json_encode($postData)
));
$response = curl_exec($ch);
服务器信息:
PHP Version: 5.3.18-nmm1
cURL Information: 7.19.7
谢谢。