MCPcopy
hub / github.com/hapijs/hapi / request

Function request

test/payload.js:860–874  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

858 await server.start();
859
860 const request = () => {
861
862 const options = {
863 hostname: '127.0.0.1',
864 port: server.info.port,
865 path: '/',
866 method: 'POST'
867 };
868
869 const req = Http.request(options);
870 req.on('error', Hoek.ignore);
871 req.write('{}\n');
872 setTimeout(() => req.end(), 100);
873 return new Promise((resolve) => req.once('response', resolve));
874 };
875
876 const timer = new Hoek.Bench();
877 const res = await request();

Callers 1

payload.jsFile · 0.85

Calls 2

onMethod · 0.65
onceMethod · 0.65

Tested by

no test coverage detected