【发布时间】:2020-07-30 09:49:47
【问题描述】:
我正在尝试在我的数据库中发布数据,但每次我尝试这样做时都会收到 405 错误。 python也有一个错误说我正在提交一个空列表。请指出我正确的方向来解决这个问题。
const axios = require('axios')
let URL = 'http://127.0.0.1:5000/Walls/saveComments'
let HEADERS = {'Content-Type': 'text/plain;charset=utf-8'}
axios.post(URL, HEADERS, {
'post': post,
'time': time
})
.then(function (response) {
console.log(response);
})
// Axios Call to Save A Post in Backend
}
【问题讨论】:
-
看起来您将参数传递给 axios.post 的顺序不正确。可以试试here吗?
-
以上有帮助吗?