javascript - Error: Request failed with status code 401 axios in React JS - Stack Overflow

PHOTO EMBED

Sun Jun 20 2021 06:06:30 GMT+0000 (Coordinated Universal Time)

Saved by @Avirup #javascript

axios.post('http://10.0.1.14:8001/api/logout',request_data, {
          headers: {
              'Content-Type': 'application/json',
              'Authorization': 'Bearer '+token
          },      
      })      
      .then((response) => {
        console.log('response',response.data)

      })
      .catch((error) => {
        alert('error',error.response)
        dispatch(userUpdateProfileFail())

      })

  // console.log('----cheers---------',data)
dispatch(userUpdateProfileSuccess(data))
content_copyCOPY

https://stackoverflow.com/questions/53495922/error-request-failed-with-status-code-401-axios-in-react-js