Yii Framework Forum: Help - POST request values is empty - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help - POST request values is empty POST request is saving with empty values

#1 User is offline   pirocoptero 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-February 18

Posted 13 February 2018 - 06:05 PM

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??

Attached File(s)


0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 08-October 12
  • Location:Austria

Posted 16 February 2018 - 04:46 AM

Hi,
This is not enough to debug. Please post your controller code
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/
http://www.yiiframew...uallistboxyii1/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#3 User is offline   Néstor Acevedo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 08-January 13
  • Location:Colombia

Posted 20 June 2018 - 06:17 PM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users