阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js ClientHttp2Stream response 事件

      Node.js ClientHttp2Stream response 事件

      新增于: v8.4.0

      The ‘response’ event is emitted when a response HEADERS frame has been received for this stream from the connected HTTP/2 server. The listener is invoked with two arguments: an Object containing the received HTTP/2 Headers Object, and flags associated with the headers.

      const http2 = require('http2');
      const client = http2.connect('https://localhost');
      const req = client.request({ ':path': '/' });
      req.on('response', (headers, flags) => {
        console.log(headers[':status']);
      });
      

      更多内容请参考:Node.js HTTP2,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录