In PHP I can fetch incoming JSON from let’s say an AJAX request by calling file_get_contents('php://input')
, I’m now rebuilding my API in NodeJS (TypeScript) and am looking for an equivalent to fetch incoming JSON.
Various web searches did not deliver what I was looing for, so I hope to find help here.
2
Answers
You can try to call the correct URL by using Axios. Following this link https://www.npmjs.com/package/axios for more.
You can use bodyparser for express and receive data via post.
Thats the way i fetch json that gets send to the server. Hope you can make something with it.