MCPcopy Index your code
hub / github.com/nodejs/node / getParsedBody

Function getParsedBody

test/parallel/test-stream-readable-async-iterators.js:833–845  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

831
832{
833 async function getParsedBody(request) {
834 let body = '';
835
836 for await (const data of request) {
837 body += data;
838 }
839
840 try {
841 return JSON.parse(body);
842 } catch {
843 return {};
844 }
845 }
846
847 const str = JSON.stringify({ asd: true });
848 const server = http.createServer(common.mustCallAtLeast(async (request, response) => {

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…