Answered by:
zip stream

Question
-
does IHttpRequest2 gzip stream? if so, how to check if the response is a zip stream. Request header "Accept-Encoding" is set to accepting "gzip", but I don't see "gzip" in GetAllResponseHeaders.
rob qqq
Tuesday, September 11, 2012 9:46 PM
Answers
-
Hi Microsoft Experts,
Please help. In general, when IXMLHTTPRequest2 Is used, how to implement HttpQueryInfo for all of flags?
rob qqq
- Marked as answer by rob qqq Tuesday, October 2, 2012 5:30 AM
Thursday, September 27, 2012 4:46 PM
All replies
-
Put in other words. Win32 API: HttpQueryInfo( request, HTTP_QUERY_CONTENT_ENCODING, encoding_buf, length); I could retrieve the encoding string. How could I do the same thing by using IHttpRequest2 interface?
rob qqq
Wednesday, September 12, 2012 4:10 PM -
Hello,
Thanks for your feedback, I will involve more experts to investigate it.
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Thursday, September 13, 2012 6:20 AM -
I mean XMLHTTPRequest2, any progress, Jesse?
rob qqq
Tuesday, September 18, 2012 2:40 AM -
Hi Microsoft Experts,
Please help. In general, when IXMLHTTPRequest2 Is used, how to implement HttpQueryInfo for all of flags?
rob qqq
- Marked as answer by rob qqq Tuesday, October 2, 2012 5:30 AM
Thursday, September 27, 2012 4:46 PM -
Hello Rob,
The use of IXmlHttpRequest2 interface is a bit different than using straight WinINet API where you have control over the decoding of the gzip response. The use of IXmlHttpRequest2 does not expose handling the gzip response from an application perspective and the interface handles that automatically for you. When the application specifies the Accept-Encoding header, the interface internally asks WinINet API to perform the decoding for you and WinINet will strip the Content-Encoding header.
Even if you are using direct WinINet API and you set the Accept-Encoding header on the request as well as set the INTERNET_OPTION_HTTP_DECODING header, the response will not have the Content-Encoding header.
In short, you cannot get the "raw" stream or the "Content-Encoding: gzip" response header when using IXmlHttpRequest2 interface.
See this link that talks about how WinINet API handles the Content-Encoding header: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383955.aspx
Thanks,
Prashant.- Proposed as answer by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, October 2, 2012 1:05 AM
- Unproposed as answer by rob qqq Wednesday, October 3, 2012 3:52 PM
Tuesday, October 2, 2012 1:05 AMModerator -
thanks. Do you have example for setting cookies using IXmlHttpRequest2? I posted another question @http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/38c686a8-b9f4-4d58-b302-d84de46e0f98. The documentation http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/38c686a8-b9f4-4d58-b302- d84de46e0f98 is too simple:)
rob qqq
Tuesday, October 2, 2012 5:29 AM -
Hi,
Are you kidding it? WinNet API cannot be used in Metro.
NEU_ShieldEdge
Tuesday, October 2, 2012 6:00 AM -
Hi Prashant,
If I want to download a zip file: http://abc.com/file.zip. I would like to keep zip content. So what API I could use if not IXMLHttpRequest2
Thanks,
Rob
rob qqq
Wednesday, October 3, 2012 1:47 PM