Help - POST request values is empty

Hey there!

I followed the instructions from yii docs "guide-rest-quick-start" , but when i try to make this request

curl -i -H "Accept:application/json" -H "Content-Type:application/json" -XPOST "myapp/users" -d '{"username": "example", "email": ""}'

the values is going blank to database. Whyy??


This is not enough to debug. Please post your controller code

Try to use $_REQUEST instead of Yii::$app->request->post() or $_POST



But check if the params are sent. Siometimes seems to work, sometimes not.