Reading response headers with Fetch API

后端 未结 6 1633
Happy的楠姐
Happy的楠姐 2020-11-28 06:42

I\'m in a Google Chrome extension with permissions for \"*://*/*\" and I\'m trying to make the switch from XMLHttpRequest to the Fetch API.

The extensio

6条回答
  •  伪装坚强ぢ
    2020-11-28 06:53

    If it's NOT CORS:

    Fetch does not show headers while debugging or if you console.log response.

    You have to use following way to access headers.

    response.headers.get('x-auth-token')
    

提交回复
热议问题