Hi
I am trying to use fetch to make a simple GET request to api.github.com.
I can see response in network panel with all the headers in place and my fetch completes successfully. The issue is when I try to get headers from my response for figuring out pagination info they are empty!
fetch(`http://api.github.com/github/fetch/issues`)
.then(response => {
// nothing here
console.log(response.headers);
}
I am using Chrome for this and running on localhost. If I switch to jsonp I can extract headers from response no problem.
Is there a way to make fetch work?
Ummm my bad! The headers were not empty. I just needed to use headers.get('Link').
Most helpful comment
Ummm my bad! The headers were not empty. I just needed to use
headers.get('Link').