[英]If you issue an http request from the chrome dev tools console, will it include the cookies of the page you're currently on?
As an example, if I'm logged into stackoverflow and I use the fetch
api in the chrome dev tools console to hit a stackoverflow.com endpoint, will my cookies from this domain be included?例如,如果我登录到 stackoverflow 并使用 chrome 开发工具控制台中的
fetch
api 访问 stackoverflow.com 端点,我来自该域的 cookie 是否会被包含在内?
Yes.是的。 If you go to the Network tab, open the console, and simply run
fetch('https://stackoverflow.com')
, you can see a request appear in the Network list.如果转到“网络”选项卡,打开控制台,然后简单地运行
fetch('https://stackoverflow.com')
,您会看到一个请求出现在“网络”列表中。 From there you can click on the request and clearly see the Request Headers (including Cookie:
, containing all your cookies sent) with a quick scroll-down, and Chrome will also give you a separate tab for viewing the cookies in a table.从那里您可以单击请求并通过快速向下滚动清楚地看到请求标头(包括
Cookie:
,包含您发送的所有 cookie),Chrome 还会为您提供一个单独的选项卡,用于查看表格中的 cookie。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.