Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在没有任何vue库(axios)的情况下在vue回调中获取http响应头_Http_Vue.js_Axios - Fatal编程技术网

如何在没有任何vue库(axios)的情况下在vue回调中获取http响应头

如何在没有任何vue库(axios)的情况下在vue回调中获取http响应头,http,vue.js,axios,Http,Vue.js,Axios,我想在vuejs的get请求回调中获取http响应头。但我不能用任何图书馆或第三方来做这件事 有一些像axios这样的第三方,但在我的代码中它是不允许使用的 fetch("YOUR API REQUEST").then((res) => console.log(res.headers); ) .then((data) => console.log(data)) .catch((err)=>console.error(err))

我想在vuejs的get请求回调中获取http响应头。但我不能用任何图书馆或第三方来做这件事

有一些像axios这样的第三方,但在我的代码中它是不允许使用的

fetch("YOUR API REQUEST").then((res) => console.log(res.headers);
)
.then((data) =>  console.log(data))
.catch((err)=>console.error(err))