title: How to use a local php file for fetch function?
body: <p>I've tried <a href="https://reactnativecode.com/react-native-insert-text-input-data-to-mysql-server/" rel="nofollow noreferrer">this</a> and i think my problem is in the fetch function.</p>
  
  <p>When I use the url from the site it works but when I use a local php file it doesn't work.</p>
  
  <pre><code>fetch(./submitData.php),{
     method: 'POST',
     headers: {
         ...
     }
  }
  </code></pre>
  
  <p>When I use the above code, I get the error:</p>
  
  <p><em>Attempt to invoke virtual method 'boolean java.lang.string(java.lang.Object' on a null object reference</em></p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>fetch('https://localhost/submitData.php', {
     method: 'POST',
     headers: {
         ...
     }
  }
  </code></pre>
  
  <p>Error: network request failed</p>