401 (Unauthorized) in Chrome, but not in IE
I suppose you have cookie-based authentication on server. In this case it could be related to credentials
key for fetch
. XHR requests, that used in jQuery always send your cookie, but using fetch
you should pass credentials
option with
same-origin
if you make request to the same origin (domain)include
otherwise
Like this:
...fetch(API_URI_HERE, {credentials: 'same-origin'})...
I assume that it works in IE because fetch
polyfill uses XHR requests under the hood.