jeudi 27 septembre 2018

Receiving HTTP data in Yii2 action with CSRF disabled

I have been trying to receive data in my Yii2 application which is been send as HTTP POST for a while now. I have tried multiple algorithms and methods but the all failed. This data is send to my application from an api. I have disabled CSRF in the controller by public $enableCsrfValidation = false; and I have set default values to be stored when this action is executed and it works. I have tried to store all the data I get from $post = Yii::$app->request->post() or $post = Yii::$app->request->get() or $post = \yii::$app->request->bodyParams. All of this methods turn to return an empty array to my action.

But It is expected that the following data structure should be returned to by action POST http://www.example2.org/notif { "status":"SUCCESS", "notif_token":"dd497bda3b250e536186fc0663f32f40", "txnid": "MP150709.1341.A00073" }

I do not know where I am getting it wrong, or what is restricting the data from reaching my controller. Any Ideas around this will be greatly appreciated



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2xHWCS6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire