MCPcopy
hub / github.com/sindresorhus/got / echoMultipartBody

Function echoMultipartBody

test/post.ts:33–38  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

31};
32
33const echoMultipartBody: Handler = async (request, response) => {
34 const body = await parse(request);
35 const entries = await Promise.all([...body.entries()].map<Promise<[BodyEntryPath, BodyEntryRawValue]>>(async ([name, value]) => [name, isBodyFile(value) ? await value.text() : value]));
36
37 response.json(Body.json(entries));
38};
39
40test('GET cannot have body without the `allowGetBody` option', withServer, async (t, server, got) => {
41 server.post('/', defaultEndpoint);

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…