|
本帖最后由 老柴228 于 2017-11-29 12:26 编辑
$.ajax({ "url": "https://d.apicloud.com/mcm/api/user/login", "type": "POST",
"cache": false,
"headers": {
"X-APICloud-AppId": "{{your_app_id}}",
"X-APICloud-AppKey": "{{加密后的key}}"
},
"data": {"username":"apicloud","password":"111111"}}
).done(function (data, status, header) {
//success body}
).fail(function (header, status, errorThrown) {
//fail body})
以上的写法有问题,正确的写法是:
var appid=....; //你的appid
var appkey=.....;//加密后的appkey,
$.ajax({ "url": "https://d.apicloud.com/mcm/api/user/login",
"type": "POST",
"cache": false,
"headers": {
"X-APICloud-AppId": appid,
"X-APICloud-AppKey": appkey
},
"data": {"username":"apicloud","password":"111111"}}
).done(function (data, status, header) {
//success body
}
).fail(function (header, status, errorThrown) {
//fail body
})
|
|