Reactjs 为什么axios post方法返回承诺{<;挂起>;}?
我想在提交函数中的reactjs中使用axios post方法,但要保持获得的axios返回承诺{} 我试图在每一步中都加入console.log,但没有人出来。我也试图更改fetch,但遇到了同样的问题Reactjs 为什么axios post方法返回承诺{<;挂起>;}?,reactjs,Reactjs,我想在提交函数中的reactjs中使用axios post方法,但要保持获得的axios返回承诺{} 我试图在每一步中都加入console.log,但没有人出来。我也试图更改fetch,但遇到了同样的问题 let product_Id = this.state.value axios.post('http://localhost:8000/api/debug',{product_Id}) .then(function(response){
let product_Id = this.state.value
axios.post('http://localhost:8000/api/debug',{product_Id})
.then(function(response){
console.log("response",response)
})
.catch(function (error) {
console.log("catch",error);
})
.finally(function(error){
console.log("finally",error);
})
我希望post可以从端点返回值。欢迎使用stackoverflow!您提供的代码片段似乎是正确的。您可以添加其余的代码吗?您是否可以在浏览器devTools的
网络面板中看到您的请求?欢迎使用stackoverflow!您提供的代码片段似乎是正确的。您可以添加其余的代码吗?您是否在浏览器开发工具的网络面板中看到您的请求?