title: PHP Script Cannot Receive Data from axios's Request in Redux Action Function
body: <p>I want to sent some data to a php script with the use of <code>redux</code> and <code>promise</code> as if the following.</p>
  
  <pre><code>export function fetchFileContent() {
      return {
          type: "FETCH_FILECONTENT",
          payload: axios.post("/api/ide/read-file.php", {
              filePath: document.getArgByIndex(0)[0]
          })
      };
  }
  </code></pre>
  
  <p>But the php script cannot receive the data. When I print all the data in <code>$_POST</code> using <code>var_dump</code>. There is nothing inside.</p>
  
  <p>I checked the <strong>Request Payload</strong> in the Google Chrome debugging tool and it seems no problem.
  <a href="https://i.stack.imgur.com/aw9XD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aw9XD.png" alt="enter image description here"></a></p>
  
  <p>In my php script:</p>
  
  <pre><code>if (isset($_POST["filePath"])) 
      echo "yes"; 
  else 
      echo "no";
  echo "I am the correct file";
  var_dump($_POST["filePath"]);
  
  $dir = $_POST['filePath'];
  echo $_POST['filePath'];
  </code></pre>
  
  <p>And I got this response:</p>
  
  <pre><code>noI am the correct file&lt;br /&gt;
  &lt;b&gt;Notice&lt;/b&gt;:  Undefined index: filePath in &lt;b&gt;/var/www/html/api/ide/read-file.php&lt;/b&gt; on line &lt;b&gt;7&lt;/b&gt;&lt;br /&gt;
  NULL
  &lt;br /&gt;
  &lt;b&gt;Notice&lt;/b&gt;:  Undefined index: filePath in &lt;b&gt;/var/www/html/api/ide/read-file.php&lt;/b&gt; on line &lt;b&gt;9&lt;/b&gt;&lt;br /&gt;
  &lt;br /&gt;
  &lt;b&gt;Notice&lt;/b&gt;:  Undefined index: filePath in &lt;b&gt;/var/www/html/api/ide/read-file.php&lt;/b&gt; on line &lt;b&gt;10&lt;/b&gt;&lt;br /&gt;
  </code></pre>
  
  <p>How can I get back the data in the php script?</p>