Relative Content

Tag Archive for javascriptreactjsfetch-api

Using new Promise vs fetch vs Axios in React

I have a Laravel application that uses Inertia and React as the front end. Recently I was getting a CORS error. Basically I was trying to use Shopify’s API to connect a user’s store and retrieve their products by using a Sales channel app I created. When I try to use axios.post from React to front end and then post to Shopify from there to receive access tokens and such I was always getting a CORS blocked because No access control header. This happened from the Shopify end as well when I tried to post from Shopify to my Laravel app using fetch.