我正在尝试在 symfony 中启用 put / delete 方法,但我总是收到此错误:
405 方法不允许
路由.yml
album_list:
pattern: /
defaults: { _controller: "AcmeAlbumBundle:Album:list"}
requirements:
_method: GET
album_show:
pattern: /{id}/show
defaults: { _controller: "AcmeAlbumBundle:Album:show" }
requirements:
_method: GET
album_index:
pattern: /index
defaults: { _controller: "AcmeAlbumBundle:Album:new" }
album_put:
pattern: /{id}
defaults: { _controller: "AcmeAlbumBundle:Album:put" }
requirements:
_method: PUT
album_delete:
pattern: /{id}
defaults: { _controller: "AcmeAlbumBundle:Album:delete" }
requirements:
_method: DELETE