显示FetchAPI POST请求的响应Cookie

我正在寻找一种方法来登录控制台,以获取POST请求的响应cookie,但是我不知道该怎么做。 例如此处:

显示FetchAPI POST请求的响应Cookie

我想在控制台中显示响应cookie名称及其值。

我已经发出了获取请求,在这里:

let headers = new Headers({
    "Content-Type"       : content-type,"User-Agent"   : user-agent
});

fetch(url,{
    method: "POST",headers: headers,credentials: 'include',body: "param=value"
})
.then((res) => res.json())
.then(function(data) {
    console.log(data);
})
.then(function(error) {
    if (error) {
        console.log(error)
    }
})

我还添加了credentials: 'include'来获取cookie,但只是不知道如何打印它们。

fengruoyang 回答:显示FetchAPI POST请求的响应Cookie

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3089565.html

大家都在问