我创建了一个 php 文件来向我的设备发送示例通知:
<?php
$ch = curl_init();
$url = "https://api.usergrid.com/ratnhanhgon/thd/devices/*/notifications";
$send = "payload=exam:hello";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $send);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec ($ch);
echo $out;
?>
但是当我运行它时,我收到了这个错误信息:
{"error":"web_application","timestamp":1417235590486,"duration":0,"exception":"javax.ws.rs.WebApplicationException"}
你能解释一下我哪里错了吗?我错过了什么?