来自netcat的web响应的最后一个数字



响应体前后的数字是什么?

有时我能得到最后一个数字,有时不能。

HTTP/1.1 200 OK
Date: Mon, 01 Jan 2021 00:01:01 GMT
Content-Type: text/plain; charset=utf-8
Server: Kestrel
Transfer-Encoding: chunked
Expires: 0
16 <-------------------- this number
API Version 1.0 <------- the actual response body
0  <-------------------- and this number

请求是:

printf 'GET / HTTP/1.1rnHost:HOSTrnrn' | nc -i 3 -v HOST 80

这是" chunked"传输编码。详细信息见RFC 7230, Section 4.1 (https://greenbytes.de/tech/webdav/rfc7230.html#chunked.encoding)。

最新更新