diff --git a/doc/api/http2.md b/doc/api/http2.md index 704e847908ba15..ca2ac644a0d4bc 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1902,7 +1902,9 @@ const req = client.request({ ':authority': `localhost:${port}` }); -req.on('response', common.mustCall()); +req.on('response', (headers) => { + console.log(headers[http2.constants.HTTP2_HEADER_STATUS]); +}); let data = ''; req.setEncoding('utf8'); req.on('data', (chunk) => data += chunk);