我想和愛可信PUT請求,我得到這個我的行動裏面至今:請求Axios |反應過來,終極版
export function updateSettings(item) {
return dispatch => {
console.log(item)
return axios.put(`/locks`).then(response => {
console.log(response)
})
}
}
當我CONSOLE.LOG item
我可以看到所有的事情我已經在我的打字輸入框內的對象,但後來我得到了404。我知道我有這個URI。有誰知道如何解決這個問題?
我會給你一個upvote指出,但我仍然得到錯誤。 –
錯誤說的是什麼?嘗試在'then'之後添加'.catch(error => console.log(error))',但它也可能是API端的錯誤,嘗試儘可能多地嘗試記錄何時和在哪裏以及爲什麼你會收到404回覆給你。 –
這是錯誤:'PUT http:// localhost:3001/locks 404(Not Found)'。 –