When axios accesses the resource, how can I get the response body when the status code of the response is 404?

Axios how to get the response body if the status code of the response is 404 when accessing the resource?

Apr.07,2021
The error returned by

is contained in


axios.get(`url`)
    .then(function (res) {
        console.log(res.data);
    })
    .catch(function (err) {
        // err.response 
        console.error(err.response);
    })
Menu