After re-installing node_modules and using json() to my fetch call, I still receive an blob response. Here is my code:
export function test() {
const url = 'http://url/api/testServlet';
return fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then((data) => {
console.log("data ", data, " --- end data");
data.json();
})
.catch((error) => {
console.error(error);
});
}
With console.log, I get:
data
{
"_bodyBlob": {
blob
},
"_bodyInit": {
blob
},
"headers": {
headers
},
"ok": true,
"status": 200,
"statusText": undefined,
"type": "default",
"url": "http://url/api/testServlet"
}
--- fin data
EDIT :
I have also an error value.hasOwnProperty('tag') that comes from nowhere I have absolutely no idea from where that comes from... I have just a component that display the result of my API call and the code I showed above.
The message is:
"Error: value.hasOwnProperty is not a function. (In 'value.hasOwnProperty('tag'), 'value.hasOwnProperty' is undefined)
I read some subjects and all was talking about this error but there was the function hasOwnProperty written in there code. Not me...