When making an axios request, I use the following code:
const response = await axios({
url,
method,
headers: headersObject,
data,
params: params || {},
});
After making the request, I examine the response
:
console.log('response.request.response')
console.log(JSON.parse(response.request.response))
console.log('data')
console.log(response.data)
To my surprise, the response.data
is not the same as
JSON.parse(response.request.response)
. In the response.data
object, the property labels
is undefined
, whereas in JSON.parse(response.request.response)
, the array labels
contains the exact labels that I expected. Could there be an issue with converting axios data to an object when a JSON key's value is an array?