title: fetch wrongly double inserts into database
body: <p>I'm using fetch to send data to a PHP script. Only Problem is that it inserts empty data first and then the correct one.
  I'm sending a JSON string which then gets decode with PHP.</p>
  <p>I've tested the script with Postman and it works fine there.</p>
  <p>Java-Script Code:</p>
  <pre><code>async function uploadImage() {
        let url = &quot;http://localhost/upload_image.php&quot;;
        navigator.geolocation.getCurrentPosition(writePosition);
        let dataJSON = {&quot;Koordinate_X&quot;:3, &quot;Koordinate_Y&quot;:1, &quot;Kategorie&quot;:1, &quot;Bild&quot;:&quot;Es klappt aus der App&quot;};
  
        fetch(url, {
          method: 'POST', // or 'PUT'
          /*headers: {
            'Content-Type': 'application/json',
          }, REMOVED*/
          body: JSON.stringify(dataJSON)
        })
      };
  </code></pre>
  <p>HTML Code:</p>
  <pre><code>&lt;button on:click={uploadImage}&gt;Upload&lt;/button&gt;
  </code></pre>
  <p>PhP Code:</p>
  <pre><code>&lt;?php 
  header('Access-Control-Allow-Origin:  http://localhost:5173');
  header('Access-Control-Allow-Headers:  Content-Type, X-Auth-Token, Authorization, Origin');
  header('Access-Control-Allow-Methods:  POST, PUT');
  
  $data = json_decode(file_get_contents('php://input'), true);
  print_r($data);
  
  //path to database file
  $database_path = $_SERVER[&quot;DOCUMENT_ROOT&quot;] . &quot;\WoIstMein.accdb&quot;;
  //check file exist before we proceed
  if (!file_exists($database_path)) {
      die(&quot;Access database file not found !&quot;);
  }
  
  //create a new PDO object
  $database = new PDO(&quot;odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=$database_path;&quot;);
  
  try{    
  $sql = 'INSERT INTO Gegenstaende (Koordinate_X, Koordinate_Y, Kategorie, Bild) VALUES (:koord_x,:koord_y,:kategorie,:bild);';
  $statement = $database-&gt;prepare($sql);
  $result = $statement-&gt;execute(array('koord_x' =&gt; $data[&quot;Koordinate_X&quot;],'koord_y' =&gt; $data[&quot;Koordinate_Y&quot;],'kategorie' =&gt; $data[&quot;Kategorie&quot;], 'bild' =&gt; $data[&quot;Bild&quot;]));
  $database = null;
  }catch(PDOException $e){
      echo $e-&gt;getMessage();
  }
  
  ?&gt;
  </code></pre>