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": "user@example.com"}'

the values is going blank to database. Whyy??

Hi,

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

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

[b]

[/b]

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