Answer the question
In order to leave comments, you need to log in
How to organize a POST request for REST yii2?
Created a controller inheriting ActiveController.
class MestypeController extends ActiveController {
public $modelClass = 'app\models\Mestypes';
public function behaviors() {
return [
[
'class' => \yii\filters\ContentNegotiator::className(),
'only' => ['index', 'view', 'create' ],
'formats' => [
'application/json' => \yii\web\Response::FORMAT_JSON,
],
],
];
}...
{
"id": 37,
"status": null,
"name": null,
"short_name": null,
"edit": 37,
"delete": 37
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question