title: How to process Vue/Axios Json payload posted data on Yii2
body: <p>It took me a while to understand this, being that it was a little obvious. I will answer myself, so other can benefit of the answer and ofcourse to see if there's a better way to do this. The problem was based on Axios/Yii2 but I guess this will apply equally to other frontend libraries/frameworks sending data to Yii2.</p>
  
  <p>I needed to post data from a small form made on Vuejs, sending the request  Axios to a Action/Controller on Yii2, so data is sent on a simple POST request and the post is getting to the controller, but I was not able to receive the data on the action, $_POST | $post arrives empty (checked using xdebug).</p>
  
  <p>As much as I remember, this had something to do with security. But I already tried by disabling public $enableCsrfValidation, so that was not the problem.</p>
  
  <pre><code>public $enableCsrfValidation = false;
  </code></pre>
  
  <p>But no matter what, data was not being added to the request/post data inside Yii2.</p>
  
  <p>The following Image, explains the problem you will find there:  </p>
  
  <ol>
  <li>The Axisos method that sends the post with test data.   </li>
  <li>The Yii2 Action stpoed at the place, I should be able to see data.  </li>
  <li>The capture of the xdebug variables and data for the request.  </li>
  <li>The capture of Chrome where you can check the payload is sent.  </li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/oN4km.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oN4km.png" alt="enter image description here"></a></p>