简体   繁体   中英

Axios POST cannot trigger after 5 POST API

I have a problem with Axios POST in ReactJS which after 5 commands sent with Axios to NodeJS, sixth cannot POST any commands.

await axios.post(`/sensors/sensors/jamming`, { sensorId });

Also, I tried to put timeout to axios to block the response but it didnot work. It would be grateful if anyone can help me.

await axios.post(`/sensors/sensors/jamming`, { sensorId }, {timeout: 1000});

I found the answer. I should add some code in backend. Actually I add below code in Nodejs. res.send(200). React JS waiting for the request from Nodejs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM