Http encoding chunked and chunked
I was not very concerned about this. This chunked is enabled by default on nginx, but not on apache. So when switching the server, I also encountered this problem, garbled data is found.
I can find out what the http header is, but it is not very clear.
Check the chunked code carefully.
Data Representation rules transmitted by http in trunked Encoding
Generally, Content-Length header information is used to specify a small value for HTTP Communication, but sometimes the information size cannot be determined, it is necessary to use trunked encoding to dynamically provide the Length of body Content.
The HTTP data transmitted by Chunked encoding must be set in the message header:
Transfer-Encoding: chunked
Indicates that the Content Body will be transmitted using chunked encoding.
Chunked encoding is generally made up of several chunks. It ends with a chunk with a length of 0.
Each chunk is dividedHeaderAndBodyTwo parts,
Header contentSpecify the total number of characters (a hexadecimal number starting with a non-zero character) and the number unit (usually not written, indicating bytes) of the next body ).
BodyIs the actual content of the specified length. The two parts are separated by carriage return line breaks (CRLF.
In the last chunk with a length of 0, the content is called footer, which is some additional Header information (which can be ignored directly ). The specific chunk encoding format is as follows:
The chunked decoding process in RFC is as follows:
The nginx server disables chunked encoding:
Chunked_transfer_encoding off;
Reference link:
Http://www.6san.com/759/
Http://www.sunnyu.com /? P = 175