How to response dynamic content in Nodejs without Express

      let reqBody = "";
      req
        .on("data", (chunk) => {
          reqBody += chunk.toString();
        })
        .on("end", () => {
        const body = new URLSearchParams(reqBody);
        res.end("ok");
        });

I’m trying to access the request’s body using NodeJS without Express but for some reason, I could not run res.end("ok");.