title: How to send data via POST method?
body: <p>I just need a way to send data via POST method, but the response is empty. Why ?</p>
  
  <p><strong>React Native code:</strong></p>
  
  <pre><code>fetch('http://justanexample.altervista.org/saveinfo.php', {
    method: 'POST',
    headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
    body: JSON.stringify({text: "blablabla", id_product: "12"})
  }).then((response) =&gt; response.text())
  .then((responseData) =&gt; { console.log("response: " + responseData); })
  .catch((err) =&gt; { console.log(err); });
  </code></pre>
  
  <p><strong>Saveinfo.php:</strong></p>
  
  <pre><code>echo "Hello World\n";
  echo json_encode($_POST);
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>response: Hello World
  []
  </code></pre>