MCPcopy
hub / github.com/nodejs/undici / postServer

Function postServer

test/promises.js:50–65  ·  view source on GitHub ↗
(t, expected)

Source from the content-addressed store, hash-verified

48})
49
50function postServer (t, expected) {
51 return function (req, res) {
52 t.strictEqual(req.url, '/')
53 t.strictEqual(req.method, 'POST')
54
55 req.setEncoding('utf8')
56 let data = ''
57
58 req.on('data', function (d) { data += d })
59
60 req.on('end', () => {
61 t.strictEqual(data, expected)
62 res.end('hello')
63 })
64 }
65}
66
67test('basic POST with string, async await support', async (t) => {
68 t = tspl(t, { plan: 5 })

Callers 1

promises.jsFile · 0.70

Calls 3

setEncodingMethod · 0.80
onMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…