title: Fetch Api Error: SyntaxError: Unexpected end of JSON input
body: <p>Im working on this api and for any reasson it returns me the message Error: </p>
  
  <blockquote>
    <p>SyntaxError: Unexpected end of JSON input.</p>
  </blockquote>
  
  <p>Im doing MySQL-connection, in here everything is ok but, the problem appears when i try to do the POST request.
  My MySQL db is working at 100%.</p>
  
  <h2>CODE API</h2>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var mysql = require('mysql');
  
  router.post("/postPersona", MiddlewareMultipart, (req, res, next) =&gt; {
      //console.log("." + req.files.Src.path.split("public")[1]);
      //console.log(req.body);
  
      var query = 'CALL addPersonas(?,?,?,?,?,?)';
      var imgPath = "." + req.files.Src.path.split("public")[1];
  
      var datos =
          [
              req.body.Nombre,
              req.body.Telefono,
              req.body.Curp,
              req.body.ECivil,
              Number(req.body.Edad),
              imgPath
          ]
  
      conn.query(query, datos, (err, results, fields) =&gt; {
          if (err) {
              console.log("Error" + err);
              res.send(JSON.stringify("Error: " + err));
          }
          else {
              console.log(results);
              res.send(JSON.stringify(results[0]));
          }
      });
  });
  </code></pre>
  
  <h2>FRONT END JS</h2>
  
  <pre><code>var Agregar = () =&gt; {
      var formData = new FormData();
      formData.append("Nombre", NomSrc.value);
      formData.append("Telefono", TelSrc.value);
      formData.append("Curp", CurpSrc.value);
      formData.append("ECivil", EstCSrc);
      formData.append("Edad", EdadSrc.value);
      formData.append("Src", ImgSrc.files[0]);
  
      var url = "http://localhost:3000/apiMYSQL/postPersona";
  
      fetch(url, {
          method: "POST",
          body: formData
      })
          .then((response) =&gt; {
              return response.json();
          })
          .then((data) =&gt; {
              console.log(data);
              alert(data);
          })
          .catch((error) =&gt; {
              console.log("Error: " + error);
          })
  }
  </code></pre>
  
  <h2>Console.log(result)</h2>
  
  <pre><code>OkPacket { 
      fieldCount: 0, 
      affectedRows: 1,
       insertId: 0, 
       serverStatus: 2, 
       warningCount: 0, 
       message: '', 
       protocol41: true, 
       changedRows: 0 
      } 
  </code></pre>