Group: HTTP Functions (WinHTTP) - Library: winhttp
Custom HttpRequest class (WinHTTP)
BOOL WinHttpReadData(
HINTERNET hRequest,
LPVOID lpBuffer,
DWORD dwNumberOfBytesToRead,
LPDWORD lpdwNumberOfBytesRead
);
DECLARE INTEGER WinHttpReadData IN winhttp;
INTEGER hRequest,;
STRING @ lpBuffer,;
INTEGER dwNumberOfBytesToRead,;
INTEGER @ lpdwBytesRead
hRequest [in] Valid HINTERNET handle returned from a previous call to WinHttpOpenRequest. WinHttpReceiveResponse or WinHttpQueryDataAvailable must have been called for this handle and have completed before WinHttpReadData is called.
lpBuffer [out] Pointer to a buffer that receives the data read.
dwNumberOfBytesToRead [in] Unsigned long integer value that contains the number of bytes to read.
lpdwNumberOfBytesRead [out] Pointer to an unsigned long integer variable that receives the number of bytes read.
Returns TRUE if successful, or FALSE otherwise.
MSDN: If you are using WinHttpReadData synchronously, and the return value is TRUE and the number of bytes read is zero, the transfer has been completed and there are no more bytes to read on the handle. This is analogous to reaching end-of-file in a local file.