Home > Enterprise >  Is there request caching in NodeJS between multiple runs?
Is there request caching in NodeJS between multiple runs?

Time:02-24

I have a simple js file that I'm running with node, eg. node index.js from the command line.

The script uses axios to POST data to an endpoint. How is it possible that if I say the data is {id: 10}, run the script, change {id: 50}, save and run the script again both POST calls still post {id: 10}?

Am I missing some caching that's in between?

Thanks

CodePudding user response:

No, there is no such caching mechanism. Some proxy between you and the server could eventually be caching, but normally no proxy will cache a POST request.

CodePudding user response:

Okay, the issue was with the API. As soon as I send the data as form-data, everything works as expected. If I try application/json, weird stuff happens.

  • Related