Answers for "axios.get Uncaught (in promise) TypeError: response.json is not a function"

0

axios.get Uncaught (in promise) TypeError: response.json is not a function

/**With axios you don't need an extra .json() .
Responses are already served as javascript object,
no need to parse, simply get response and access data.
You could use directly something like
*/


axios.get('/user/12345')
  .then(function (response) {
    console.log(response.data);
    console.log(response.status);
    console.log(response.statusText);
    console.log(response.headers);
    console.log(response.config);
  });
Posted by: Guest on April-24-2022

Code answers related to "axios.get Uncaught (in promise) TypeError: response.json is not a function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language