When I used the AngularJS
service of $http
to store data through LeanCloud
's REST API
, I found that the data could be stored, but the data could not be deleted. When using $http.delete(), I saw an error on the console. The information is: Method DELETE is not allowed by Access-Control-Allow-Methods.
, but you can use the LeanCloud
online testing tool on the REST API
official website. It is also possible to send requests directly through Git Bash
, as follows:
curl -X DELETE
-H "X-AVOSCloud-Application-Id: *********************"
-H "X-AVOSCloud-Application-Key: *********************"
https://api.leancloud.cn/1.1/classes/GameScore/51e3a334e4b0b3eb44adbe1...
I don’t know where the problem is, whether it’s AngularJS
’s problem or LeanCloud
’s problem. It’s so confusing.
过去多啦不再A梦2017-05-15 16:55:01
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.