【发布时间】:2020-10-29 22:36:59
【问题描述】:
假设在漂亮的打印之后,我的 http/2 数据包显示如下:
Layer HTTP2:
Stream: HEADERS, Stream ID: 85, Length 169, POST xxxxxxxxxx
Length: 169
Type: HEADERS (1)
Flags: 0x24
.... ...0 = End Stream: False
.... .1.. = End Headers: True
.... 0... = Padded: False
..1. .... = Priority: True
00.0 ..0. = Unused: 0x00
0... .... .... .... .... .... .... .... = Reserved: 0x0
.000 0000 0000 0000 0000 0000 0101 0101 = Stream Identifier: 85
Pad Length: 0
0... .... .... .... .... .... .... .... = Exclusive: False
.000 0000 0000 0000 0000 0000 0000 1011 = Stream Dependency: 11
Weight: 21
Weight real: 22
等等等等。 我试图通过写下以下命令来提取“流 ID”:
print(cap[i].http2.stream['stream_ID'])
我尝试了上述方法,因为“流”字段对我来说就像字典的键值对。但它没有用。 您能帮我了解如何从上述代码中提取“Stream ID”的值吗? 附言“流”是“http2”数据包的字段名称,它给了我
Stream: HEADERS, Stream ID: 19, Length 30, POST xxxxxxx
当我应用命令时
print(cap[i].http2.stream)
【问题讨论】:
标签: python python-3.x http2 pyshark