title: AWS Lambda + API Gateway POST Error
body: <p>I have a simple Lambda function that takes in some text, and returns that text as a response. I hooked it up with AWS API Gateway and tested it out in their console and also on Postman. I enabled CORS, and the headers on Postman seem to be right, the <code>Access-Control-Allow-Origin</code> is set to *.</p>
  
  <p>Here's the Postman result:</p>
  
  <p><a href="https://i.stack.imgur.com/tgxlU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tgxlU.png" alt="enter image description here"></a></p>
  
  <p>I couldn't get it working on my local, so I decided to host a static page here:</p>
  
  <p><a href="https://smileyfacetest.firebaseapp.com/" rel="nofollow noreferrer">https://smileyfacetest.firebaseapp.com/</a></p>
  
  <pre><code>test = {"text": ":)"}
  $.post( "https://pq8thdrp0a.execute-api.us-west-2.amazonaws.com/dev", test)
      .done(function( data ) {
         console.log(data);
      });
  </code></pre>
  
  <p>But still got an error of:</p>
  
  <pre><code>XMLHttpRequest cannot load https://pq8thdrp0a.execute-api.us-west-2.amazonaws.com/dev. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://smileyfacetest.firebaseapp.com' is therefore not allowed access. The response had HTTP status code 400.
  </code></pre>
  
  <p>Is there anything I'm doing wrong on the frontend? If it's working on Postman, and I have CORS enabled on the endpoint for the API, I don't see why it should be throwing an error. Any help would be really appreciated!</p>
  
  <p>Here's the API endpoint if you want to try it in Postman:</p>
  
  <p><a href="https://pq8thdrp0a.execute-api.us-west-2.amazonaws.com/dev" rel="nofollow noreferrer">https://pq8thdrp0a.execute-api.us-west-2.amazonaws.com/dev</a></p>