Answer the question
In order to leave comments, you need to log in
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);
}
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question