title: axios error react interceptors request is not a function
body: <p>i have a configuration with axios i am testing a feature to receive a list of students from an api, the problem is that it sends me an error:</p>
  <blockquote>
  <p>TypeError:
  <em>constants_api_constants__WEBPACK_IMPORTED_MODULE_1</em>_.default.interceptors.request
  is not a function</p>
  </blockquote>
  <p>For my axios configuration I use:</p>
  <pre><code>const options.GET_ALL_STUDENTS = {
    method: &quot;GET&quot;,
    url: &quot;/Student&quot;,
  }
  const BASE_API_URL = &quot;https://localhost:7072/api&quot;;
  const api = axios.create({
    baseURL: `${BASE_API_URL}`,
  });
  
  const getStudents = () =&gt; {
    return api.interceptors.request(options.GET_ALL_STUDENTS).use(
      function request(success) {
        return success;
      },
  
      function error(err) {
        return err;
      },
    );
  };
  </code></pre>
  <p>How I resolve my promise, (without interceptor this work fine):</p>
  <pre><code>function* fetchStudents() {
    try {
      const result1 = yield call(getStudents);
      const studentList = createStudentListAdapter(result1.data);
      yield put(fetchStudentsSuccess(studentList));
    } catch (error) {
      yield put(fetchStudentsFailure());
    }
  }
  </code></pre>