【问题标题】:How to get http responce headers in vue callback without any vue library (axios)如何在没有任何 vue 库的情况下在 vue 回调中获取 http 响应标头(axios)
【发布时间】:2019-10-19 14:36:51
【问题描述】:

我想在来自 vuejs 的 get 请求的回调中获取 http 响应标头。但是我不能为此使用任何库或第三方。

有一些第三方如axios,但在我的代码中是不允许使用的。

【问题讨论】:

    标签: http vue.js axios


    【解决方案1】:
    fetch("YOUR API REQUEST").then((res) => console.log(res.headers);
    )
    .then((data) =>  console.log(data))
    .catch((err)=>console.error(err))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-03
      • 2019-07-30
      • 2018-03-11
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 2022-12-22
      • 2023-02-15
      相关资源
      最近更新 更多