You are not logged in.
use THttpClientSocket / TWinhttp to grab some html-content, but response is chunked.
searched in syncommons.pas & syncrtsock.pas without any clue, any hint? thank you !
Offline
Got it , SynCommons.IsContentCompressed SynZip.CompressGZip can do it.
Offline
IIRC there is no unchunking method in the framework yet.
The "chunk" in SynZip is not the HTML chunk, it is a proprietary compression mechanism added to ZIP, working on binary blocks/chunks of 64KB.
Offline
Do some research again, there are some misleading in my answer. ab you are right, The framework has no strip chunked logic. But the winhttp has.
https://stackoverflow.com/questions/251 … tpreaddata
https://msdn.microsoft.com/en-us/librar … 2147217396
Starting in Windows Vista and Windows Server 2008, WinHttp enables applications to perform chunked transfer encoding on data sent to the server. When the Transfer-Encoding header is present on the WinHttp response, WinHttpReadData strips the chunking information before giving the data to the application.
API-WinHttpReadData() auto strip the chunked-response, then send the data to application. Only when we wants to send chunked request, some manually code is needed before we call WinHttpSendRequest().
So my last correct output is a coincidence, winhttp does it. then CompressGZip() can decompress correctly.
Offline