Posting forms - WeOnlyDo Discussion board

Posting forms (wodHttpDLX)

by nova, Sunday, January 23, 2005, 14:38 (7043 days ago)

Hi,

I am testing out the HttpDLX product, so far it seems great and i think it will be very useful, but i need to establish whether it can do a couple of things that i need, and if so a simple example of how to if it could be provided would be excellent. As soon as i know it does what i need i will be snapping up a license.

Anyway, i want to be able to load a page over http, say for example my little stats page for some shares or something, but thatpage requires me to login, so it has a form with a username/password combination of fields. What i want is to be able to load the page, fill in the username/password, submit the form and get logged in and then navigate to the stats i want and extract the elements i want from the body.

Is this possible with this com? If so a simple example would be very usefull, as i cannot see anything like this in your bundled examples.

Thanks! [:happy:]

Re: Posting forms

by wodSupport, Sunday, January 23, 2005, 15:00 (7043 days ago) @ nova

Nova,

yes, this is possible. Usually, you don't need to fill out forms. Instead I think you should POST some data to the server (that would include username/password) that would authenticate you - and as a result you could get back page you need.

As for the sample - there are really 1000 ways to do this, so I wouldn't go into details. If you have specific page you already use using Internet Explorer, I could rewrite it to use wodHttpDLX from VB if that would help.

But I suggest you look at this example from our helpfile:
http://www.weonlydo.com/HttpDLX/Help/wodHttpDLXLib~HttpRequestFormPost.html
and
http://www.weonlydo.com/HttpDLX/Demo/TestFormPost.htm
you have corresponding example in our installation. This sample requires username/pass, I think in the way you will need it.

I hope this helped.

Re: Posting forms

by nova, Sunday, January 23, 2005, 15:47 (7043 days ago) @ wodSupport

Thanks for your quick reply!

I think that i should be able to work out what i want from the details you have given, thanks a lot.

I have just one other question, that i hope you can help me with.

Whilst testing what i want to do i am just using hotmail as an example, and am loading it up getting bounced about (load balancers etc) til i end up at the login screen which the url for is http://login.passport.net/uilogin.srf?id=2

The problem is that it is always returning an error Host not found. when i try to load that url, which after some investigation seems to be because I am not accepting the cookies.

I tried adding something like this to the IwodHttpNotify_HeadersDone:

For Each oldcookie In httpx.Response.Cookies
If InStr(httpx.Request.Cookies.ToString, oldcookie.Name) = 0 Then
httpx.Request.Cookies.Add oldcookie.Name, oldcookie.Value
End If
Next

which is simply looking if the cookie name exists, and if not adding it to the requst object from the response object. but after some more communication the request object seems to lose the cookies, and ends up as a null string. Is there a reason for this, as i cannot find it in your documentation. And all the forms i wish to use this dll on use a cookie authentication method just like this example.

Thanks again in advance, just dont want to speand $400 and not be able to use the dll if you understand what i mean.

Cheers

Re: Posting forms

by wodSupport, Sunday, January 23, 2005, 15:50 (7043 days ago) @ nova

Nova,

yes, you're correct. Cookies are the problem here.

Can you write small VB (or any other language) sample that demonstrates exact problem you have, zip it and send it to techsupport@weonlydo.com - so we can help you change it so it works correctly. I'm sure you can open new hotmail account we could both test with.

Would that be ok?

Re: Posting forms

by nova, Sunday, January 23, 2005, 15:57 (7043 days ago) @ wodSupport

Sounds great.

I already put it into a Cls file anyway, so i will send you the details shortly.

Thanks again, what excellent service!