我有以下代码:
const config = { headers: { "Content-Type": "application/json" } };
const data = JSON.stringify({ postId });
console.log('sending request'); // prints
const response = await axios.post(
`http://${GATEWAY}:5000/api/posts/single`,
data,
config
);
console.log("response received"); // never reached
但是当我改变
const response = await axios.post(...
到
const res = await axios.post(...
或与此相关的任何其他字词,response received
都会被打印,并且该应用不会崩溃。有人对此有见识吗?内存泄漏?