这就是我一直尝试到现在,没有得到我犯错误的地方。
公司链接= 'https://www.linkedin.com/voyager/api/identity/profiles/';
让cookie =“cookie 1 = nj 9 ucrk 32 lohmd 89 mbuab 5 mjra 79 t61 o 8 c3 u8 bgl;第二个小甜饼= ae 0 f5 d277 f1255 f7 cf 869 fcf 2bf 914;cookie 3 =ae0f5d277f1255f7cf869fcf2bf914”
async function fetchImpexDetails(){
try{
const response = await fetch(companyLink,{
method:'POST',
credentials: "include",
headers:{
'Cookie': cookies,
"Content-type":"multipart/form-data"
}
});
const data = await response.formData();
console.log(data);
return data;
}
catch(error){
console.log(error);
}
}
fetchImpexDetails().then(data=>{
console.log(data);
})
1条答案
按热度按时间flseospp1#
根据规范,您不能在Cookie标头中添加多个Cookie
When the user agent generates an HTTP request, the user agent MUST NOT attach more than one Cookie header field.
应该使用
Set-Cookie
标头,每个标头对应一个要设置的值