title: How to convert Axios data to Fetch body in POST method?
body: <p>Well this is my Axios POST request:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, {useState} from "react";
  import Axios from "axios";
  
  const [data, setData] = useState({
    number: "",
    password: "",
    code: ""
  })
  
  function handle(e) {
  
      const newdata = { ...data };
      newdata[e.target.id] = e.target.value;
      setData(newdata);
      // console.log(newdata);
  }
  
  function submit(e) {
  
      e.preventDefault();
  
      const url = 'EXAMPLE';
  
      Axios.post(url, {
          number: data.number,
          password: data.password,
          code: data.code
      }).then((response) =&gt; {
          if (response.ok) {
              return response.json();
          }
          throw new Error('Something went wrong.');
      })
          .then((responseJson) =&gt; {
  
              // console.log(responseJson.number);
              console.log(responseJson);
  
          }).catch((error) =&gt; {
          console.log(error + ", Or Please check your internet connection and try again.");
      })
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Which is working fine and I recieve respond from server,
  But when I convert it to the Fetch like This:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, {useState} from "react";
  
  const [data, setData] = useState({
      number: "",
      password: "",
      code: ""
  })
  
  function handle(e) {
  
      const newdata = { ...data };
      newdata[e.target.id] = e.target.value;
      setData(newdata);
      // console.log(newdata);
  }
  
  function submit(e) {
  
      e.preventDefault();
  
      const url = 'EXAMPLE';
  
      fetch(url, {
          method: 'POST',
          body: JSON.stringify(data)
      }).then((response) =&gt; {
          if (response.ok) {
              return response.json();
          }
          throw new Error('Something went wrong.');
      })
          .then((responseJson) =&gt; {
  
              // console.log(responseJson.number);
              console.log(responseJson);
  
          }).catch((error) =&gt; {
          console.log(error + ", Or Please check your internet connection and try again.");
      })
  }</code></pre>
  </div>
  </div>
  </p>
  <p>it doesn't work and when I use Network =&gt; Payload tab Request is working just like Axios, But no respond is detected.
  Why is that happening? maybe I'm missing something?
  My convert is wrong in body?</p>