Flask Application Error: Cors Origin Error

0

I'm encountering an issue with my Flask application where I'm unable to retrieve a response. When I entered the URL provided by sam deploy --guided after building it using sam build to get the page displayed on the browser, the page displays the user-entered message appropriately. However, there is no response. I get the following error: Sam-cli commands: sam build sam deploy --guided sam remote invoke Enter image description here I tried to enable Cors but it failed to update why? Enter image description here

Enter image description here

asked 6 months ago175 views
2 Answers
0

Enter image description here

Even after mentioning following header on enabling CORS I am getting this why I am not getting that. I am able to send response but not getting it back. When I select option from method section CORS header applied Sucessfully for Get method it always failed.

answered 6 months ago
  • It looks like you have successfully configured API Gateway.

    As for the problem of CORS communication continuously failing, please open the Network tab of the Developer Tools and check how the request is going. Are you getting a 200 response to OPTIONS?

0

I am not sure about this answer, but did you also select the OPTIONS side? The preflight request is made for OPTIONS in CORS communication. If there are no OPTIONS, OPTIONS should be set automatically, but since there are already OPTIONS, it may not be possible to set them, and an error may occur.

If you can share the details of the error, we can get some more ideas.

FYI

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions