L
L
leha782016-09-20 15:32:34
Yii
leha78, 2016-09-20 15:32:34

How to get POST data from outside (enableCsrfValidation disabled)?

There is a need to receive data from outside. Or rather from the Android application. But $_POST comes empty. Tried disabling enableCsrfValidation but doesn't help. on the same hosting, another php engine receives data. What limitations still exist in Yii2?

public function beforeAction($action)
  {            
      if ($action->id == 'index') {

          Yii::$app->controller->enableCsrfValidation = false;

      }

      return parent::beforeAction($action);
  }

Disabled for actionIndex

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-09-22
@webinar

if $_POST is empty, then your android app sent it empty. What does yii have to do with it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question