title: How do you express it using the fetch API in JavaScript?
body: <p>Now, I POST image data using ajax(jquery) as follows. The <code>image</code> is a <code>File</code> object.</p>
  <pre><code>async function postImage({ image }) {
    const result = await $.ajax({
      method: 'POST',
      url: '/api/images',
      dataType: 'json',
      data: image,
      processData: false,
      async: true,
      headers: {
        'Content-Type': 'application/octet-stream',
      },
    });
    return result;
  }
  </code></pre>
  <p>The result that return object is <code>{id: imageID}</code>.
  How can I express this using the <code>Fetch API</code>? I couldn't get the <code>result</code> even if I did the following.</p>
  <pre><code>const result = await fetch('/api/images', {
      method: 'POST',
      body: image,
      headers: {
        'Content-Type': 'application/octet-stream',
      },
    });
  return result;
  </code></pre>