After receiving the http response I notice a hexadecimal number after the header, immediately before the content. And at the end - 0. That is, the content is as if enclosed between these figures. What are these numbers?


HTTP/1.1 200 OK Date: Wed, 06 Jul 2011 10:36:25 GMT Server: Apache/2.2.9 (Unix) mod_perl/2.0.4 Perl/v5.8.8 Set-Cookie: ************************************************* Vary: Accept-Encoding Connection: close Transfer-Encoding: chunked Content-Type: text/xml 3380 <--------- Вот здесь непонятная цифра (взята произаольно) <?xml version="1.0" encoding="utf-8"?> <list> xml-текст </list> 0 <--------- И здесь (всегда 0) 

    2 answers 2

    These are the sizes of the chunks (parts) of the response in bytes, expressed in hexadecimal form.

    Because HTTP requires a terminal (final) chunk, then its size is 0. After 0, by the way, there should be a line break.

    In your case, the answer consists of two chunks:

    • An xml document with the size of 0x3380 (13184) bytes;
    • terminal empty chunk.

    You can find out the meaning of these numbers from the author of the web server (documentation), or (more likely) from the documentation on the protocol used for communication.