0

What are the numbers that come before and after the response body?

Sometimes I get the last number and sometimes I do not.

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

The request was:

printf 'GET / HTTP/1.1\r\nHost:HOST\r\n\r\n' | nc -i 3 -v HOST 80
Bena H
  • 33
  • 4
  • 1
    Does this answer your question? [Can you explain chunked encoding?](https://stackoverflow.com/questions/3829145/can-you-explain-chunked-encoding) – Joe Mar 08 '21 at 05:35
  • Thank you! That definitely helped. – Bena H Mar 08 '21 at 19:13

1 Answers1

1

It's the "chunked" transfer encoding. Details in RFC 7230, Section 4.1 (https://greenbytes.de/tech/webdav/rfc7230.html#chunked.encoding).

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98