|
[云开发]
云推送API 帮忙看下这段代码问题出在哪里?
[复制链接]
本帖最后由 imocms 于 2014-11-12 06:46 编辑
- <?php
- $appkey = sha1("A6968288501831UZ4D046199-05CD-08A3-6EEF-3F74507C134BUZ".microtime()).microtime();
- header('X-APICloud-AppId: A6968288501831; X-APICloud-AppKey:'.$appkey);
- $url = 'https://p.apicloud.com/api/push/message';
- $data=array(
- "title"=>$post_ID,
- "content"=>"ceshi neirong",
- "platform"=>"2"
- );
- echo do_post($url,$data);
- echo $appkey;
- function do_post($url, $data) {
- $ch = curl_init ();
- curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, TRUE );
- curl_setopt ( $ch, CURLOPT_POST, TRUE );
- curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
- curl_setopt ( $ch, CURLOPT_URL, $url );
- $ret = curl_exec ( $ch );
- curl_close ( $ch );
- return $ret;
- }
- ?>
复制代码 还有麻烦你们官方的api文档写的规范点好么 都要自己一点一点的去猜测规范格式下面这段代码是你们的官方API
var now = Date.now();
varappKey = sha1(“A6968565094002+”UZ”+” 62FB16B2-0ED6-B460-1F60-EB61954C823B”+UZ+now)+”.”+now 顿时无语了!!!!
|
|