因为如果我用Fiddler来监控的话是:
CRUD Method Path With Idempotent? action
---- ------ ---- ---- ----------- ------
Create POST /foos/ No create
Retrieve GET /foos/:id Yes show
Update POST /foos/:id _method=put Yes update
Destroy POST /foos/:id _method=delete Yes destroy
so PUT
and DELETE
(作为 HTTP 动词)实际上并未使用。但为什么 Rails 书籍和参考文献总是说它是PUT
and DELETE
?
因为网络browsers没有接口可以生成PUT
or DELETE
要求。
当然,您编写的客户端有足够的灵活性来使用PUT
and DELETE
正如预期的那样,但浏览器实际上只能使用GET
and POST
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)