Using axios as the main HTTP manipulator in our application allows us to use request and response interceptors. Those are used to manipulate the data before sending it to the server or when receiving the data, manipulating it before sending it back to the JavaScript code.
The most common way an interceptor is used is in JWT token validation and refreshing the requests that receive a specific error or API error manipulation.
In this recipe, we will learn how to create a request interceptor to check the POST, PATCH, and DELETE methods and a response error manipulator.