PowerShell Invoke-WebRequest 不发送 cookie

问题描述

为什么这个 PowerShell 代码不发送 cookie。

示例:

Invoke-WebRequest -Uri "https://example.com/" -Headers @{
"method"="GET"
  "authority"="example.com"
  "scheme"="https"
  "path"="/"
  "pragma"="no-cache"
  "cache-control"="no-cache"
  "sec-ch-ua"="`"Google Chrome`";v=`"89`",`"Chromium`";v=`"89`",`";Not A Brand`";v=`"99`""
  "sec-ch-ua-mobile"="?0"
  "upgrade-insecure-requests"="1"
  "user-agent"="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/89.0.4389.82 Safari/537.36"
  "accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
  "accept-encoding"="gzip,deflate,br"
  "accept-language"="ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7"
  "cookie"="test1=none; test2=none"
}

需要改变什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)