将 withCredentials 设置为新的 ES6 内置 HTTP 请求 API : Fetch

set withCredentials to the new ES6 built-in HTTP request API : Fetch

如何将 withCredentials=true 设置为 fetch,return 承诺。 以下是否正确:

fetch(url,{
   method:'post',
   headers,
   withCredentials: true
});

我认为 MDN documentation 谈到了关于 http 请求的所有内容,除了这一点:withCredentials

知道了 here :

  credentials: 'include'

而不是

  withCredentials: true