MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / getTextBody

Function getTextBody

packages/core-apps/src/http.ts:3–15  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

1import { IncomingMessage, RequestListener } from "http";
2
3export const getTextBody = (req: IncomingMessage) =>
4 new Promise<string>((resolve) => {
5 let body = "";
6 req.on("readable", () => {
7 const chunk = req.read();
8 if (chunk) {
9 body += chunk;
10 }
11 });
12 req.on("end", () => {
13 resolve(body);
14 });
15 });
16
17export class HttpReply {
18 constructor(private response: Parameters<RequestListener>[1]) {}

Callers 2

#createHttpServerMethod · 0.90
#createHttpServerMethod · 0.90

Calls 1

onMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…