title: Why is my fetch command not passing the body to AWS API Gateway?
body: <p>I have a stage in AWS API Gateway that takes <code>POST</code> requests. If I call this API Gateway with Postman, everything works as expected. I can see in CloudWatch logs, that the body of the POST is present. The body is as follows (shortened):</p>
  <pre><code>{
      &quot;Success&quot;: &quot;1&quot;,
      &quot;Item&quot;: {
          &quot;IngameName&quot;: &quot;SomeName&quot;,
          &quot;Timestamp&quot;: &quot;Mon Oct 12 2020 19:07:29 GMT+0100 (British Summer Time)&quot;
      }
  }
  </code></pre>
  <p>I also set a header for the content type in Postman: <code>Content-Type : application/json</code>.</p>
  <p>I try to make the same call again using <code>fetch</code> in JavaScript:</p>
  <pre><code>let testJson = {
      &quot;Success&quot;: &quot;1&quot;,
      &quot;Item&quot;: {
          &quot;IngameName&quot;: &quot;SomeName&quot;,
          &quot;Timestamp&quot;: &quot;Mon Oct 12 2020 19:07:29 GMT+0100 (British Summer Time)&quot;
      }
  };
  fetch(apiGatewayAddressLocal, {
      method: 'POST',
      body: JSON.stringify(testJson),
      headers: {
          'Content-Type': 'application/json'
      }
  });
  </code></pre>
  <p>The <code>fetch</code> call reaches API Gateway successfully, but CloudWatch logs say that the body is empty. I have also tried doing <code>json.parse</code> instead of <code>json.stringify</code> but this gives me <code>Unexpected token</code> errors in the console. I saw some solutions including <code>Accept:application/json</code> as a header, which I tried but does not fix the solution. I also tried the <a href="https://stackoverflow.com/a/51854096/7062012">solution suggested here</a>, but then I could not reach API Gateway at all.</p>
  <p>I have double checked that <code>apiGatewayAddressLocal</code> definitely contains a valid link, it is the same as I used in Postman</p>
  <p>Why is my <code>fetch</code> call not passing any body to API Gateway?</p>