首页 > 解决方案 > Vue Axios 不返回响应

问题描述

我有 vue axios 的问题。

我正在尝试使用 get / put 发送数据,但我无法在服务器端读取它。使用 POST 一切正常,所以我不知道问题是什么。顺便提一句。一切都在 PostMan 中运行。

axios({
    method: 'PUT',
    url: `http://example.org`,
    data:  Qs.stringify(data),
}).then(response => (console.log(response.data)))

标签: vue.jspostgetaxiosput

解决方案


我正在以这种方式使用 axios PUT 并且效果很好..

axios.put("http://example.org", "plaintextbodyorstringifiedmaybe", {headers: {"Content-Type": "text/plain"}}).then(response => (console.log(response.data)))

推荐阅读