Fetch: Headers are empty when making GET request to github api

Created on 23 Jul 2016  路  1Comment  路  Source: github/fetch

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?

Most helpful comment

Ummm my bad! The headers were not empty. I just needed to use headers.get('Link').

>All comments

Ummm my bad! The headers were not empty. I just needed to use headers.get('Link').

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seekcx picture seekcx  路  4Comments

ccorcos picture ccorcos  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  4Comments

sndsgn picture sndsgn  路  3Comments

shirotech picture shirotech  路  3Comments