Situation: 1) I need to make HTTP[S] networking calls in C++ on Windows for our DLL. 2) Need to support at least XP (I guess SP3 is ok) 3) no ATL, no MFC, no IE
Question: I recently switched from Boost cpp-netlib to using MSXML's IXMLHTTPRequest for our (very simple) networking needs on windows. While everything seemed to work great, we noticed that redirects don't work. In fiddler I get a HTTP 302, followed by the second successful HTTP 200 request/response.
However in the actual C++ code I get E_ACCESSDENIED from IXMLHTTPRequest->Send and the HTTP response code is zero. So in the code I have no way to know what actually happened.
Since from Fiddler everything was working, I tried making it async and checking the callback, also tried IXMLHttpServerRequest, IXMLHttpServerRequest2 and MSXML v6, but none worked.
Note: We use IXMLHttpRequest2 on WinRT and that works fine (handling the OnRedirect event).
Is there anyway to get MSXML's IXMLHTTPRequest to handle redirects?
Or do I need to switch to WinInet/WinSockets/WinHttp? I take it I need to use WinHttp (since I need to support Windows Services/IIS, which WInInet apparently doesn't, and WinSockets is too low level for my needs I think).
Thanks!