首页 > 解决方案 > AWS API Gateway 403 Forbidden response OPTIONS

问题描述

I am trying to call API of AWS through JEE and I got this error in the Chrome Console

[![enter image description here][1]][1] But when I call same API from postman or when I use it in localhost it works.

Whats wrong ?

标签: amazon-web-servicesaws-api-gateway

解决方案


In your API Gateway OPTIONS method, go into Method Response and add a response header with the name 'Access-Control-Allow-Origin'.

enter image description here

Now go into Integration Response, expand the default 200 response and in Header Mappings put the URL of your DNS. If you don't want to restrict by URL, just put a *.

enter image description here

You may need to add this configuration to other methods as well.


推荐阅读