request.interceptors.request.use(async (url, options) => {
if (
options.method === 'post' ||
options.method === 'put' ||
options.method === 'delete' ||
options.method === 'get'
) {
const headers = {
'Content-Type': 'application/json',
Accept: 'application/json',
token:localStorage.getItem("token")
};
return {
url,
options: { ...options, headers },
};
}
});