|
我要请求统计api,按照以下方法不能实现,请问我该怎么改呢?谢谢
var now = Date.now();
var appKey =sha1("A6059947345267" + "UZ" + "应用key" + "UZ" + now) + "." + now;
$.ajax({
type: 'post',
dataType : "jsonp",//数据类型为jsonp
timeout: 10000,
beforeSend: function(xhr) {
xhr.setRequestHeader("AppId", "A6059947345267");
xhr.setRequestHeader("AppKey", appKey);
},
url: 'https://r.apicloud.com/analytics/',
data: {
'startDate': '2017-10-10',
'endDate': '2017-10-18',
'appKey': appKey
},
success: function(data) {
alert(1)
},
complete: function(XMLHttpRequest, status) { //请求完成后最终执行参数
//alert(2)
console.log(XMLHttpRequest)
console.log(status)
}
});
|
|