How can I get the response payload content?
I have the following axios call which is failing because of authorization issue. Hence, I want to display a message (maybe growl) on the screen once control reaches catch block. I can see the response payload in the Network tab but its not showing up when I am printing err.response as shown in the code below. const currentDate = new Date() let deliverDate = getFormattedDate(currentDate); const data = { downloadType: '1', dataDeliveryPojo: { id: '0', deliveredBy: JSON.parse(sessionStorage.getItem('loggedInUser')).personId, deliveredToPersonId: JSON.parse(sessionStorage.getItem('loggedInUser')).personId, deliverDate: deliverDate, purposeId: 10, companyId: 1234, personId:JSON.parse(sessionStorage.getItem('loggedInUser')).personId }, }; /* The response.data returned from Axios is a JSON string. So creating a Blob from that JSON doesn't produce the correct object. Hence, make sure to tell axios to return blob From the Axios docs: // responseType indicates the type of data that the server will respond with // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' // browser only: 'blob' responseType: 'json', // default */ axios.post('api/fileDownload', data, {responseType :'blob'} ).then((blob) => { let fileName = ""; let disposition = blob.headers['content-disposition']; let filenameRegex = /filename[^;=  ]*=((['"]). "); console.log(err.response); })  The output of console.log(err.response); in the console is: