title: Proper Way to Make API Fetch 'POST' with Async/Await
body: <p>I'm working on a project that requires me to make requests to an API. What is the proper form for making a <code>POST</code> request with Async/Await?</p>
  <p>As an example, here is my fetch to get a list of all devices. How would I go about changing this request to <code>POST</code> to create a new device? I understand I would have to add a header with a data body.</p>
  <pre><code>getDevices = async () =&gt; {
    const location = window.location.hostname;
    const response = await fetch(
      `http://${location}:9000/api/sensors/`
    );
    const data = await response.json();
    if (response.status !== 200) throw Error(data.message);
    return data;
  };
  </code></pre>