0
我不太了解怎么我的卷曲呼叫格式的山魈API ...发送带有卷曲JSON对象到特定的URL
$specific_api = "/messages/send.json";
$url = "https://mandrillapp.com/api/1.0/" . specific_api . "?";
$param_array = array(
'key' => $apikey,
'template_name' => 'mytemplate',
'template_content' => array(
'name' => 'main',
'content' => 'This is HAPPENING RIGHT NOW!'
),
'message' => array(
'subject' => 'blanketID Service: Pet Found',
'from_email' => '[email protected]',
'from_name' => 'blanketID Service',
'to' => array(
'email' => '[email protected]',
'name' => 'Devin Columbus'
)
)
);
$encoded = json_encode($param_array);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);
$data = curl_exec($ch);
curl_close($ch);
$arr = json_decode($data, true);
echo $data;
我真的甚至不相信,我已经得到这一切正确的设置...
我在想''''''部分没有意思.. – dcolumbus
是的,你可以离开'?'超出网址。您正在使用POST请求而不是GET。 – trickyzter