title: AWS API gateway giving 400 bad request error
body: <p>I am using API gateway + JWT based authorization to secure my AWS lambda functions. I am able to get correct policy in my aws console for the authorizer. The lambda function I am trying to access is working fine separately. It's working fine when I change authorization to none for <code>GET_CUSTOMERS_URI</code> and I get data. But when combined together using API gateway, it's giving 400 bad request errors. I understand this has something to do with how the request is being made from the front-end but I am unable to figure that out.</p>
  <p>My fetch request looks like this[React app]:-</p>
  <pre><code>return await fetch(GET_CUSTOMERS_URI, {
    method: 'GET',
    mode: 'cors', 
    cache: 'no-cache', 
    credentials: 'same-origin', 
    headers: {
        'authorizationToken': 'Bearer ' + token,
        'Content-Type': 'application/json'
    },
    redirect: 'follow', // manual, *follow, error
    referrerPolicy: 'no-referrer',
  
  })
  </code></pre>
  <p>Policy returned from the authorizer(tested using the AWS console):-</p>
  <pre><code>{
    &quot;Version&quot;: &quot;2012-10-17&quot;,
    &quot;Statement&quot;: [
      {
        &quot;Action&quot;: &quot;execute-api:Invoke&quot;,
        &quot;Effect&quot;: &quot;Allow&quot;,
        &quot;Resource&quot;: &quot;arn:aws:execute-api:us-west-2:&lt;account id&gt;:&lt;api id&gt;/&lt;stage-name&gt;/GET/customers&quot;
      }
    ]
  }
  </code></pre>