抓一个 2000KB左右的页面,老是抓一半,一开始以为是网络问题,然后以为是连接断了,最后实在没办法去读文档才发现原来默认最多是1MB。
引用
maxBodySize
Connection maxBodySize(int bytes)
Set the maximum bytes to read from the (uncompressed) connection into the body, before the connection is closed, and the input truncated. The default maximum is 1MB. A max size of zero is treated as an infinite amount (bounded only by your patience and the memory available on your machine).
Parameters:
bytes - number of bytes to read from the input before truncating
Returns:
this Connection, for chaining
Connection maxBodySize(int bytes)
Set the maximum bytes to read from the (uncompressed) connection into the body, before the connection is closed, and the input truncated. The default maximum is 1MB. A max size of zero is treated as an infinite amount (bounded only by your patience and the memory available on your machine).
Parameters:
bytes - number of bytes to read from the input before truncating
Returns:
this Connection, for chaining
希望google到我这的不要再去查了,我查了大约一小时。