|
- var now = Date.now();
- var appKey =hex_sha1("0000000001"+"UZ"+ "00001-00001-00001-00001-00001KJKJDLSKK"+"UZ"+now)+"."+now;
- var postdata={
- title:"用户消息",
- content:"你妈叫你回家吃饭!!!",
- type:1,
- platform:0
- }
- $.ajax({
- type: "POST",
- url:"https://p.apicloud.com/api/push/message",
- data:postdata,
- dataType:"json",
- error: function(XHR,textStatus,errorThrown) {
- alert ("XHR="+JSON.stringify(XHR)+"\ntextStatus="+textStatus+"\nerrorThrown=" + errorThrown);
- },
- success: function(data,textStatus) {
- alert(data);
- },
- headers: {
- "X-APICloud-AppId":"0000000001",
- "X-APICloud-AppKey":"<span style="line-height: 1.5;">00001-00001-00001-00001-00001KJKJDLSKK</span><span style="line-height: 1.5;">"</span>
复制代码 ==================================================(以上AppId 和AppKey 并非测试真实ID 和Key)
以上请求发生错误,返回结果为:
XHR={"statusText":"","status":0,"responseURL":"","response":"","responseType":"","responseXML":null,"responseText":"","upload":{"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null},"withCredentials":false,"readyState":4,"timeout":0,"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null}
textStatus=abort
errorThrown=null
|
-
返回错误信息
|