title: How to post data in php via react js
body: <p>I am new to react js please see below my post API call in react </p>
  
  <pre><code>updateData = datas =&gt; {
      axios
        .post("http://localhost:8080/ReactAPI/post.php", datas)
        .then(function(body) {
          console.log(body);
        })
        .catch(function(error) {
          console.log(error);
        });
  }
  </code></pre>
  
  <p>and PHP file post.php code given below:</p>
  
  <pre><code>&lt;?php
  
  header('Access-Control-Allow-Origin: *');
  header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
  header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, X-Requested-With");
  
  print_r($_POST);
  ?&gt;
  </code></pre>
  
  <p>console i give response body just like given below:</p>
  
  <pre><code>{data: "Array↵(↵)↵", status: 200, statusText: "OK", headers: {…}, config: {…}, …}
  </code></pre>
  
  <p>I pass <code>datas</code> given below to i aspect in response</p>
  
  <pre><code>{id: "41", userId: "3672367892", fullName: "Subhash Patel"}
  </code></pre>
  
  <p>Please help me out here how to recieve the <code>datas</code> response in post.php file</p>