Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HttpGet() won't follow redirection
Message
From
16/05/2018 16:24:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
West Wind Web Connection
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Miscellaneous
Thread ID:
01659865
Message ID:
01660019
Views:
63
>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?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform