WinINet Via Proxy
-
I want to query the last modified time on a file before I download it from the Internet. Unfortunately I'm connected via an MS proxy server which requires the domain name as well as username and password. I've successfully got a response code by using the following WinINet functions:
InternetOpen() InternetConnect() HttpOpenRequest() HttpSendRequest() HttpQueryInfo()
whereHttpQueryInfo()
looks something like this:HttpQueryInfo(hResourceHandle, HTTP_QUERY_FLAG_NUMBER |
HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL))Note that I set my internet options for using the proxy using the handle returned from HttpOpenRequest().
HttpSendRequest()
returned a response code of 200 - OK. So now I want to get the last modified details, so I change theHttpQueryInfo()
call to something like this:char szLastModified[32];
DWORD dwLengthLastModified = sizeof(szLastModified);
HttpQueryInfo(hResourceHandle, HTTP_QUERY_LAST_MODIFIED,
szLastModified, &dwLengthLastModified, NULL))Unfortunately, it fails and
GetLastError()
reports an error code of 12150 - "requested header could not be located". Can anyone spot what I'm doing wrong? "The folly of man is that he dreams of what he can never achieve rather than dream of what he can." "If you think education is expensive, try ignorance."