我的反应应用程序使用 axios 向服务器发送 POST 请求。当服务器需要超过 2 分钟来响应请求时,再次调用。但仅在 FF、Chrome 中,不在 IE11 中。我不认为这是一个跨域资源共享 (CORS) 预检问题,因为这只发生在响应时间较长的请求中。
Client:
axios.post("host:port/context", {
params,
headers: {
"Content-Type": "text/plain"
}
});
Server:
const server = http.createServer();
server.listen(4000);
server.setTimeout(240000);
server.keepAliveTimeout = 240000;
A Router from express is also used on the server:
const router = new Router();
router.post(
"/context",
handlingOfRequest()
);