CakePHP ajax post keeps returning 400 Bad Request

前端 未结 4 595
北海茫月
北海茫月 2021-02-09 19:41

I am tring to use an ajax post to an action. GET requests work fine but when I try to POST I see a \'400 Bad Request\' in firebug and the view return a \'Black hole\' response.<

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-09 20:05

    Joseph's answer was missing one detail for me. My form and ajax call was in index.ctp and was calling /controller/edit.ctp so my $this->Form->create call needed 'action'=>'/controller/edit' added to it.

提交回复
热议问题