angular.js - LeanCloud Rest API
阿神
阿神 2017-05-15 16:53:01
0
1
521

我使用AngularJS$http服务通过LeanCloudREST API对数据进行存储时发现可以存储数据,但是不能够删除数据,使用$http.delete()时看到控制台报错信息是:Method DELETE is not allowed by Access-Control-Allow-Methods.,但是使用LeanCloud官网上面的REST API在线测试工具是可以的。直接通过Git Bash发送请求也是可以的,如下:

curl -X DELETE \
-H "X-AVOSCloud-Application-Id: *********************" \
-H "X-AVOSCloud-Application-Key: *********************" \
https://api.leancloud.cn/1.1/classes/GameScore/51e3a334e4b0b3eb44adbe1...

不知道哪里出现问题,是AngularJS的问题,还是LeanCloud的问题,好纠结。

阿神
阿神

闭关修行中......

reply all(1)
过去多啦不再A梦

You need to open the browser console and confirm whether the X-AVOSCloud-Application-Id and X-AVOSCloud-Application-Key parameters in the HTTP Header are correct. You can refer to the data management page of the console to perform related operations and then view the network request format. This is also implemented through angular. It should have nothing to do with angular itself.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!