shicheng
2008-10-13 07:48:00 UTC
Hi,
I want to get the field "Location" from the HTTP header using
WinHttpQueryHeaders, but it fails with error code
ERROR_WINHTTP_HEADER_NOT_FOUND. I don’t know why because the field
"Location" exists in the header which can be seen by a network monitoring
tool. I want to get this field because I want to get the file name of the
required resource just as IE does.
This is the code I used:
WinHttpQueryHeaders(hRequest,
WINHTTP_QUERY_LOCATION,
WINHTTP_HEADER_NAME_BY_INDEX,
NULL,
&dwSize,
WINHTTP_NO_HEADER_INDEX);
I print the all the header and find the field “Location” is not there.
This is the code I used:
WinHttpQueryHeaders(hRequest,
WINHTTP_QUERY_RAW_HEADERS_CRLF,
WINHTTP_HEADER_NAME_BY_INDEX,
NULL,
&dwSize,
WINHTTP_NO_HEADER_INDEX);
Can anyone tell me how to get the required resource name please? Thank you!
I want to get the field "Location" from the HTTP header using
WinHttpQueryHeaders, but it fails with error code
ERROR_WINHTTP_HEADER_NOT_FOUND. I don’t know why because the field
"Location" exists in the header which can be seen by a network monitoring
tool. I want to get this field because I want to get the file name of the
required resource just as IE does.
This is the code I used:
WinHttpQueryHeaders(hRequest,
WINHTTP_QUERY_LOCATION,
WINHTTP_HEADER_NAME_BY_INDEX,
NULL,
&dwSize,
WINHTTP_NO_HEADER_INDEX);
I print the all the header and find the field “Location” is not there.
This is the code I used:
WinHttpQueryHeaders(hRequest,
WINHTTP_QUERY_RAW_HEADERS_CRLF,
WINHTTP_HEADER_NAME_BY_INDEX,
NULL,
&dwSize,
WINHTTP_NO_HEADER_INDEX);
Can anyone tell me how to get the required resource name please? Thank you!