Amplify-js: Single API request makes 2 requests

Created on 26 Sep 2019  路  3Comments  路  Source: aws-amplify/amplify-js

* API Requests *

* Lambda *

When making http requests using the API module, and noticed that upon calling the function once APP.get() for example, it makes 2 requests, 1 with OPTIONS method and it makes the original request after the first ones response. Im looking to improve the performance of My application and this is really getting in the way.

Please help me understand why is it so, any work arounds or how to disable it completely !?
Thanks in advance :smile:

API question

All 3 comments

That's standard HTTPS practice, you'll see the same thing if you use axios to invoke your AppSync endpoint directly.

Hi @Fawwad-Khan

Yeah, as @jkeys-ecg-nmsu mentioned, this is standard practice in web browsers.

If you'd like more info about it, take a look at Preflight request

@jkeys-ecg-nmsu, @manueliglesias Thanks a lot for clearing it up, oddly enough I didn't find anything on it while I was google, maybe I didnt phrase it right :sweat_smile: , Thanks again :smiley:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guanzo picture guanzo  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

ldgarcia picture ldgarcia  路  3Comments

romainquellec picture romainquellec  路  3Comments

epicfaace picture epicfaace  路  3Comments