title: Invalid JSON data in request body: Syntax error POST Call Rest API YII2
body: <p>When I try to post using Postman,I get this error  <code>{"name":"Bad Request","message":"Invalid JSON data in request body: Syntax error.","code":0,"status":400,"type":"yii\\web\\BadRequestHttpException"}</code></p>
  
  <p>My controller is </p>
  
  <p>`class CountryController extends ActiveController
  {
      public $modelClass = 'app\models\Country';</p>
  
  <pre><code>public function behaviors()
  {
      return [
          [
             'class' =&gt; 'yii\filters\ContentNegotiator',
             'only' =&gt; ['index', 'view','create'],
             'formats' =&gt; ['application/json' =&gt; Response::FORMAT_JSON,],
  
          ],
          'verbs' =&gt; [
              'class' =&gt; VerbFilter::className(),
              'actions' =&gt; [
                  'index'=&gt;['get'],
                  'view'=&gt;['get'],
                  'create'=&gt;['post'],
                  'update'=&gt;['put'],
                  'delete' =&gt; ['delete'],
                  'deleteall'=&gt;['post'],
              ],
  
          ],
      ];
  }
  </code></pre>
  
  <p>}`</p>
  
  <p>added </p>
  
  <pre><code>'parsers' =&gt; [
                  'application/json' =&gt; 'yii\web\JsonParser',
              ]
  </code></pre>
  
  <p>in <strong>api/config.php</strong> file.</p>
  
  <p>Where I am wrong??</p>