Put in order · JavaScript and React course · Module 11: Data Fetching and APIs

Configuring a Request Interceptor

Arrange the steps for adding a request interceptor in Axios:

Items to put in order

  • api.interceptors.request.use(config => {
  • config.headers.Authorization = Bearer ${token};
  • return config; })
  • const token = localStorage.getItem('authToken');

You can check the correct answer by solving this task in the CodeWorlds game.