I am trying to use a function fetchto retrieve data from a server on the client side Javascript code. And I am using a polyfill extraction version with a name whatwg-fetchin Chrome (which supports internal fetching).
This is how I call the function:
fetch("http://localhost:8080/list", {
mode: 'no-cors',
credentials: "include",
})
.then(function(response) {
return response.json();
});
As you can see, my application server does not match my resource server, so I had to set the parameters for CORS. The problem is that responseit has no content:
{
body: null,
bodyUsed: false,
headers: Headers,
ok: false,
status: 0,
statusText: "",
type: "opaque",
url: "",
}
In the case when I go to the network panel and find the sent request, it seems that everything is fine with the status of 200 and the requested data.
How can I find the problem?