Sending Post To Controller Gives Me A Badrequest


I try to send a POST to my Controller, but all I get back is a BadRequest…

GET Requests are working fine…

Hope somebody can help me on this,


Do you have any access rules set in your controller around post?

I’ve not yet used Yii 2, but in Yii 1, this would suggest a missing or invalid CSRF token.

A missing/invalid CSRF token can happen if you are generating any HTML markup yourself without using yii methods to generate the active form or the form inputs (i.e. $form->field).