title: How to Fetch API Using ES6
body: <p>I'm very new to API and ES6. How will i able to post the username and password and get a response if it is incorrect. BTW, this site is not working.
  <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>    fetch('http://thisissamplewebsite.com', {
      method: 'post',
      body: JSON.stringify({
          email: document.getElementById('email').value
          answer: document.getElementById('answer').value
      })
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Consume API&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="POST"&gt;
  &lt;input type="email" id="email" placeholder="email"  value="aaa@yahoo.com"/&gt;
  &lt;input type="password" id="password" placeholder="password"  value="12345"/&gt;
  &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>