title: AWS API Gateway working through CURL but not working through javascript
body: <p>Hi I am trying to hit a AWS API gateway it's working fine on CURL but not working from JS
  Brocking for CROS policy.
  But from AWS I already enabled CROS </p>
  
  <pre><code>$.ajax({
          url: ApiURL,
          type: 'POST',
          dataType: 'json',
          contentType: "application/json",
          data: JSON.stringify(hash),
          async: true,
          crossDomain: true,
          crossOrigin: false,
          headers: {
          'accept': 'application/json',
          'Content-Type': 'application/json',
          'Access-Control-Allow-Origin': '*',
          'Access-Control-Allow-Headers': '*',
          'Access-Control-Allow-Methods': 'POST'
          },
  </code></pre>
  
  <p>CURL method hit through AJAX</p>
  
  <pre><code>$.ajax({
          url: stripTrailingSlash(BASE_URL) + '/contact/send',
          type: 'POST',
          dataType: 'json',
          contentType: "application/json; charset=utf-8",
          data: JSON.stringify(body),
          async: true,
          headers: {
              'X-CSRF-Token': csrfToken
          },
  </code></pre>
  
  <p>My api gateway POST structure like this</p>
  
  <p>My lambda response I did like this</p>
  
  <pre><code>const response = {
  statusCode: statusCode,
  
   headers:{ 'Access-Control-Allow-Origin' : '*' },
  body: JSON.stringify({
    message: responceMessage,
    input: event,
  }),
  };
  callback(null, response);
  </code></pre>
  
  <p>Error I am getting in my browser</p>