SQLExpress - Xb2.NET     ot4xb  
xb2net
Re: xb2net & rewritten/redirected URLs
Thread Starter: Boris Borzic Started: 2/19/2008 3:51 PM UTC
Replies: 6
Re: xb2net & rewritten/redirected URLs
Thomas Braun <spam@software-braun.de> wrote in
news:s0cgyo9t95wz$.l94i0kdh7akw.dlg@40tude.net:  

I'm currently using Alaskas LoadFromURL()function to send data via
"POST"-method to a php-based web application.
The problem in this case seems to be that LoadFromURL does not send
the POST data again after being redirected to the new URL.
Does anybody know if this works with xb2net?

Yes it should work just fine.  

It's easy to try yourself by downloading Xb2.NET. Send an email to demo@xb2.net for download instructions and ZIP file password.

Once you have Xb2.NET, here's some pseudo code for you to modify:

 oHttp := xbHTTPClient():new()
 oHttp:Transport := VIA_WININET
 // create the form that we will post to the server
 oForm := xbForm():new()
 oForm:SetVar("VAR1", "AAA")
 oForm:SetVar("VAR2", "BBB")
 // execute HTTP request
 oResponse := oHttp:Execute("http://mydomain.de/test",,oForm)
 // display response content
 MemoEdit(oResponse:Content, 0, 0, MaxRow(), MaxCol())

Please also have a look at the samples GETWEB.PRG and POSTWEB.PRG

Best regards,
Boris Borzic
-- news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools
Re: xb2net & rewritten/redirected URLs
Hi Boris,

as discussed over at the Alaska newsgroup, I'm almost sure that this is
"standard" or "expected" behaviour... because Internet Explorer and Firefox
do not send the POST data on redirection as well.

I'm not sure what you are using inside xb2net, but if you are using high
level functions from Wininet.dll like HttpSendRequest(), this might have
the same problem.

It's easy to try yourself by downloading Xb2.NET. Send an email to demo@xb2.net for download instructions and ZIP file password.

Thanks for your suggestion...

Unfortunately, this does not work as your Provider seems to have blocked a
whole range of IPs used by my provider (Deutsche Telekom) and unfortunately
my emailserver is running on one of those addresses :-((

Maybe you can send it directly to me by email.

regards
Thomas
Re: xb2net & rewritten/redirected URLs
Thomas Braun <spam@software-braun.de> wrote in
news:1p90poxtvcaqd.1n6ehbbhnu048$.dlg@40tude.net:  

Unfortunately, this does not work as your Provider seems to have
blocked a whole range of IPs used by my provider (Deutsche Telekom)
and unfortunately my emailserver is running on one of those addresses

Well, I suppose one way to stop spam is to stop accepting emails <g>. We may need to go back to snail mail in order to have reliable communication.

Maybe you can send it directly to me by email.

It has been sent.

Best regards,
Boris Borzic
-- news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools
Re: xb2net & rewritten/redirected URLs
Thomas Braun <spam@software-braun.de> wrote in
news:1p90poxtvcaqd.1n6ehbbhnu048$.dlg@40tude.net:  

as discussed over at the Alaska newsgroup, I'm almost sure that this
is "standard" or "expected" behaviour... because Internet Explorer and
Firefox do not send the POST data on redirection as well.
I'm not sure what you are using inside xb2net, but if you are using
high level functions from Wininet.dll like HttpSendRequest(), this
might have the same problem.

Try the pseudo-code I posted yesterday. If that does not work, you can accomplish your task by using the low level socket and HTTP request/response objects.  

Have a look at POSTWEB.PRG function "Method2". You will need to add the additional logic to check the response status and resubmit to a new URL if you receive a 302.

Best regards,
Boris Borzic
-- news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools
Re: xb2net & rewritten/redirected URLs
Boris Borzic wrote:

> Unfortunately, this does not work as your Provider seems to have
> blocked a whole range of IPs used by my provider (Deutsche Telekom)
> and unfortunately my emailserver is running on one of those addresses
Well, I suppose one way to stop spam is to stop accepting emails <g>. We may need to go back to snail mail in order to have reliable communication.

*sigh*

It has been sent.

Thanks - email recieved!

Thomas
Re: xb2net & rewritten/redirected URLs
Thomas Braun <spam@software-braun.de> wrote in news:u94wdq3vj9cl.1kmuufmvahe7u$.dlg@40tude.net:

Thanks - email recieved!

Great! Let us know how you make out with testing.

Best regards,
Boris Borzic
-- news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools
Re: xb2net & rewritten/redirected URLs
Boris Borzic wrote:

> Thanks - email recieved!
Great! Let us know how you make out with testing.


OK - but don't expect any news before middle/end of next week because I
have to work on a different project meanwhile :-)

Thomas