title: Post json data using fetch api failed
body: <p>Am new in javascript , and am trying to <strong>POST</strong> data with an API endpoint but data is not posting , I have printed in the console , but I see <code>Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0</code> in Google chrome.</p>
  
  <p><strong>But internet connection is good and stable.</strong></p>
  
  <p>This is my vanilla javascript for posting data :</p>
  
  <pre><code>function onSignUp() {
    signupform
    var email = document.signupform.email_edt.value;
    var driver_rb = document.getElementById("driver_rb").checked;
    var password_edt = document.signupform.password_edt.value;
    var r_password_edt = document.signupform.r_password_edt.value;
    var url = 'https://tuvuge-app.herokuapp.com/api/v1/signup';
    //var data = {username: 'example'};
    var data = {
      username: email,
      email: email,
      password: password_edt,
      isDriver: 'True'
    };
  
    fetch(url, {
        method: 'POST',
        body: JSON.stringify(data), // data can be `string` or {object}!
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res =&gt; res.json())
      .catch(error =&gt; console.error('Error:', error))
      .then(response =&gt; console.log('Success:', response));
  }
  </code></pre>
  
  <p>Then I attached the <code>onSignUp()</code> function to the button in html as below : </p>
  
  <pre><code>&lt;form class="admin-modal-content" name="signupform" onSubmit="onSignUp();" action="index.html" method="post"&gt;
    &lt;div class="container"&gt;
      &lt;h4&gt;Sign Up&lt;/h4&gt;
      &lt;p&gt;Please fill in this form to create an account.&lt;/p&gt;
      &lt;hr&gt;
      &lt;label for="email"&gt;
        &lt;b&gt;Email&lt;/b&gt;
      &lt;/label&gt;
      &lt;input type="email" placeholder="you@example.com" id="email_edt" name="email_edt" required&gt;
      &lt;label for="email"&gt;
        &lt;b&gt;Select an Option&lt;/b&gt;
      &lt;/label&gt;
      &lt;p&gt;
        &lt;input type="radio" name="driver_rb" value="driver" id="driver_rb"&gt;
        &lt;label&gt;Driver&lt;/label&gt;
      &lt;/p&gt;
      &lt;p&gt;
        &lt;input type="radio" name="passenger_rb" id="passenger_rb" value="passenger"&gt;
        &lt;label&gt;Passenger&lt;/label&gt;
      &lt;/p&gt;
      &lt;label for="psw"&gt;
        &lt;b&gt;Password&lt;/b&gt;
      &lt;/label&gt;
      &lt;input type="password" placeholder="Enter Password" id="password_edt" name="password_edt" required&gt;
      &lt;label for="psw-repeat"&gt;
        &lt;b&gt;Repeat Password&lt;/b&gt;
      &lt;/label&gt;
      &lt;input type="password" placeholder="Repeat Password" id="r_password_edt" name="psw-r_password_edt" required&gt;
      &lt;div class="clearfix"&gt;
        &lt;button type="submit" class="btn"&gt;Sign Up&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What am I missing ,because the endpoint has a message it brings when there's a success or failure of data posting , but I see the above message.</p>
  
  <p>What am I missing?</p>