如果我真的需要使用这些方法,我如何确保它们是安全的?
编辑:是否有链接或来源,我可以看到如何确保“PUT”和“DELETE”方法无法删除或更新资源,但服务和 servlet 仍然能够使用 PUT 和 DELETE。
以下服务正在使用 PUT 和 DELETE HTTP 方法
https://developers.google.com/drive/v2/reference/files/delete
http://developers.facebook.com/docs/reference/api/Comment/
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html
http://www.salesforce.com/us/developer/docs/api_rest/index.htm
http://developer.tradeshift.com/rest-api/#tsapi.conventions
http://developer.linkedin.com/documents/groups-api#create
https://developer.paypal.com/webapps/developer/docs/api/#delete-a-stored-credit-card
因此,显然必须有一种方法来确保可以使用 PUT 和 DELETE,而不会使资源文件(如 HTML、CSS、JS 或图像)受到损害。