You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After searching for a solution I found this:
The Headers class instance that fetch returns is an iterable, as opposed to a plain object like axios returns. Some iterable's data, such as Headers or URLSearchParams, aren't viewable from the console, you have to iterate it and console.log each element, like:
fetch('http://localhost:9876/test/sample-download',{method: 'post',headers: {},body: {}}).then(response=>{// Inspect the headers in the responseresponse.headers.forEach(console.log);// OR you can do thisfor(letentryofresponse.headers.entries()){console.log(entry);}}).catch(err=>console.error(err));
I'm requesting data from Wordpress Api, which serves some data in response headers:
But on Logging response get empty object. see below image

But in network request getting headers. see below image

Please resolve this issue, if not already or Guide me with the solution.
The text was updated successfully, but these errors were encountered: