fetch() POST request to Express.js generates empty body {}
问题 Goal: send some defined string data from HTML in a fetch() function e.g. "MY DATA" My code: HTML <!DOCTYPE html> <html> <body> <script type="text/javascript"> function fetcher() { fetch('/compute', { method: "POST", body: "MY DATA", headers: { "Content-Type": "application/json" } } ) .then(function(response) { return response.json(); }) .then(function(myJson) { console.log(myJson); }); } </script> </body> </html> Server.js var express = require("express"); var app = express(); var compute =