>Hmmm... wwHttp should auto-redirect as long as the redirect is a 301 or 302.
>
>In fact, WinInet requires that you explicitly turn redirect off and that flag exists in wconnect.h (INTERNET_FLAG_NO_AUTO_REDIRECT).
>
>One issue is that a REDIRECT cannot POST. Redirect just re-routes a URL it does not send data so that's probably why the redirect URL fails with a 401 Not Found (invalid endpoint for GET operation).
>
>Since this is an API I think what's supposed to happen is that you turn off Auto redirect, capture the status code, check for 301/302 and then pick up the Location header to figure out the page you need to submit to. Convoluted yes, but I believe required if they are using redirects.
I don't know what these guys are doing, the "Found. Redirecting to /#/portal/..." is in the HTML I get - and this is a call which has to be a POST, it's sending a bunch of urlencoded XML. My liaison is scheduling a talk with them so we'll see. This is a staging server for testing the new version (the old version is several years in production) so I guess some of it may be jury-rigged. We'll see.
Thanks for the tips - more things to try before we get on the phone with them. More ammo to bring to the table is always welcome.
>>Now it redirects me from
www.someserver.com/portal/services to /#/portal?query= and then I'm supposed to add xml={actual xml here} to the url. However, HTTPGet() just returns the redirection but of course can't follow it. Tried to navigate directly to
www.someserver.com/#/portal?query= but it seems that some bit gets lost in the process. In the headers returned I get a "1.1 404 not found", and the buffer returned contains some html saying "Cannot POST /".
>>
>>The service is 99% serving browser clients, i.e. other web apps. I seem to be their only fat client (though opinions may vary, I got only 86kg), going HttpGet() without a browser, so... anyone knows a trick for this?