CakePHP初心者です。
/Main/View1/001
とゆうパスからユーザデータを取得するPOSTをcontrollerに送りたいのですが、試しに /Main/Send とゆうメソッドにPOSTを行った所以下エラーが出ます。
code:400 file: "......\vendor\cakephp\cakephp\src\Controller\Component\SecurityComponent.php" line:329 message: "URL mismatch in POST data (expected '/Main/View1/001' but found '/Main/Send')" url:"/Main/View1/001"
ViewではページをリロードしたくないのでそのばでPOSTの返り値を受け取りたいのですが、どうすればいいのでしょうか。。
ちなみにAppControllerで
$this->loadComponent('Security'); $this->loadComponent('Csrf');
をロードしています。
さすがに、Securityコンポーネントを読み込んだだけで動的階層のページ全てにCSRF対策が影響される事くらいは対応したメソッドが有ると思うのですが、エラー内容から調べてもそれらしい結果が見当たりませんでした。
回答1件
あなたの回答
tips
プレビュー