开发者

404 error when posting form data in cakephp

开发者 https://www.devze.com 2023-04-06 17:58 出处:网络
I have a RESTful api in a cakephp app that returns json data.I am testing it with firefox REST Client.The GET requests work fine, but I am getting 404 errors I dont understand when posting form data.T

I have a RESTful api in a cakephp app that returns json data. I am testing it with firefox REST Client. The GET requests work fine, but I am getting 404 errors I dont understand when posting form data. The failing requests look like this:

404 error when posting form data in cakephp

.

If I change the content-type to "text/html" I don't get a 404 anymore, although I do not get the expected response, presumably because the form data is not being posted.

Any ideas wha开发者_如何转开发t's going on?


I figured out the problem. The cakephp security component needed the csrf token. Setting "validatePost" to false on that compoment fixed the issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消