After converting my project over to Ionic 3 using httpclient, I’m now running into the problem where my .Net api endpoint is running twice on post calls. This only happens the first time I hit a given endpoint. Subsequent calls only cause it to fire once.
Seeing as I’m specifying json headers I’m assuming an Options preflight request is the culprit, but I’m confused why the endpoint is processing both requests. Shouldn’t the preflight just confirm the post can be made and not actually deliver a payload to the endpoint? Are subsequent calls using cached info that alleviates future Options requests when hitting the same endpoint?
My logic inside the clients post subscribe is only getting hit once with a single response but my server logic is running twice, causing duplicate records being created. Is there a setting in IIS to configure or does Ionic posts using httpclient require more configuration? I’m assuming it’s related to httpclient as no other changes were made to the logic when converting to Ionic 3.
Any ideas or direction is appreciated.