vendredi 1 juillet 2016

How do I enable CORS?


I am unable to enable CORS on any resources from AWS Api Gateway.

I used the "Enable Cors" button present on the web UI:

enter image description here

But attempting to use in development or production yields:

enter image description here

I'm using jQuery 2.2.4 and the method $.post.

What's going wrong?

UPDATE: test staging:

enter image description here

SUCCESS UPDATE:

AWS documentation can be quite large. What I failed to realize is that you must EXPORT a client generated SDK which has a global variable that generates methods based on the resources you provided. As such, I can FINALLY return a succesfull result when I use THIS code:

  const apigClient = apigClientFactory.newClient();

    apigClient.purchaseTokenPost({}, card, {})
        .then(function(result){
            console.log(result);
        }).catch(function(result){
            console.log(result);
        });

Aucun commentaire:

Enregistrer un commentaire