await axios .post( executeBatch, { headers: { "Content-Type": "application/json", "x-access-token": localStorage.getItem("token"), }, } ) .then( (response) => this.$store.commit( "insertOutputFile", response.data.outputFile._id ), ); alert("You can download the result");
So sometimes I get an empty response with status code 200, Considering retrying the request if this happens, I want to know what is the correct way to solve this problem.
I think axios interceptor is suitable for you.
You can create the setupAxios file in the base redux directory and export it from index.js in the base redux directory.
And define setupAxios
from the root index.js fileBy the way, I'm using react.js, it might be a little different in vue.js.