打印给定 url 的 HTTP 协议版本
我正在使用 Vue CLI 构建一个 web 应用程序来分析 http 响应。我使用 axios 发出 get 请求,并使用 chrome 扩展允许发送跨域请求。
我的目标是打印 HTTP 协议版本,因为我在 axios 响应中找不到它,但我可以使用 chrome 开发工具看到它。
下面是我处理 axios 请求的方式:
axios({
method: this.userMethod,
url: url,
})
.then((r) => {
this.response = r;
};
})
.catch((e) => {
console.error(e);
});
其中“url”是 URL 对象。
这是我激活后从网站(本例中为 StackOverflow)得到的响应CORS 扩展。
我想要得到的是 chrome 开发工具显示的“h2”协议版本。我的目标是获取它并将其打印在屏幕上,但我在 axios 响应中找不到它。 我已经使用命令行阅读了有关“curl”的内容,这也可以用 Javascript 实现吗?还是我完全偏离了方向?
I'm building a webapp using Vue CLI to analyze http responses. I'm using axios to make get requests and a chrome extension which allows to send cross-domain requests.
My goal is to print HTTP protocol version, as I can't find it in the axios response but I can see it using chrome dev tools.
Here how I handled the axios request:
axios({
method: this.userMethod,
url: url,
})
.then((r) => {
this.response = r;
};
})
.catch((e) => {
console.error(e);
});
Where 'url' is a URL object.
This is the kind of response I get from a site (StackOverflow in this example) once I activate the CORS extension.
What I want to get is the "h2" protocol version that chrome dev tools shows. My goal is to take that and print it on screen, but I can't find it in the axios response.
I've read about 'curl' using the command line, Is that possible with Javascript too or am I completely off path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论