Error with wodhttp - WeOnlyDo Discussion board

Error with wodhttp (General questions)

by celtik, Friday, November 21, 2008, 21:31 (5845 days ago)

I am getting the following response:

The requested connection has been refused by the remote host.

I have coded in wodHttp many times before, but I have forgot how to do many things. I am simply trying to check to see if an account is valid or invalid to make things easier on me. Here is some code:

Private Sub Command1_Click()
HTTP.Disconnect
HTTP.URL = login.myspace.com/index.cfm?fuseaction=login.process
HTTP.Request.FormPost.Add email , Text1.Text
HTTP.Request.FormPost.Add password , Text2.Text
HTTP.Request.FormPost.Add Remember , Remember
HTTP.Request.FormPost.Add Loginbutton , Login
HTTP.Post
End Sub

Private Sub Form_Load()
HTTP.Request.UserAgent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
HTTP.Request.Accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
End Sub

Private Sub HTTP_Done(ByVal ErrorCode As Long, ByVal ErrorText As String)
Dim oldcookie As HttpCookie
For Each oldcookie In HTTP.Response.Cookies
HTTP.Request.Cookies.Add oldcookie.Name, oldcookie.Value
Next
If ErrorCode = 0 Then
HTTP.Disconnect
RichTextBox1.Text = HTTP.Response.Body
If InStr(1, RichTextBox1.Text, 302 Object Moved ) Then
HTTP.Get home.myspace.com/index.cfm?fuseaction=user
RichTextBox1.Text = HTTP.Response.Body
Label1.Caption = INVALID
End If
If InStr(1, RichTextBox1.Text, My Friend Space ) Then
Label1.Caption = VALID
End If
Else
RichTextBox1.Text = ErrorText
End If
End Sub [code][/code]

Re: Error with wodhttp

by woddrazen, Friday, November 21, 2008, 22:00 (5845 days ago) @ celtik

Celtik


Please change URL line to this:
[code]HTTP.URL = http.URL = http://login.myspace.com/index.cfm?fuseaction=login.process [/code]

Also did you check for example using IEWatch (http analizing tool) what should be send to connect to your server?


Drazen

Re: Error with wodhttp

by celtik, Friday, November 21, 2008, 22:23 (5845 days ago) @ woddrazen

I am not sure what IE Watch is, but I think I would be interested in checking it out so please point me in the right direction. Also, that fixed the error, but now my body looks like this:

<!-- -->

I don't think it has anything to do with wod, so I think IE Watch may help me post everything that I need

Re: Error with wodhttp

by woddrazen, Friday, November 21, 2008, 22:45 (5845 days ago) @ celtik

Celtik,


IEWatch is http and https analyzing tool . You can use it to find out all data that should be posted in wodHttpDLX to connect to server.

Also why don't you use wodHttpDLX in blocking mode when all commands is executed line by line? I think it's easier.

Please also change URL Property with Get Method using same url as argument in Get Method. HTTP.Request.Cookies.Add please add before Post Method and after Get Method.

Let us know how it goes.


Drazen

Re: Error with wodhttp

by celtik, Friday, November 21, 2008, 22:56 (5845 days ago) @ woddrazen

OK, I tried to d the things you said but I had some problems. I do not have cookies defined in the command so it will not allow me to do http.request.cookies.add oldcookie.name, oldcookie.value

Also, where do I get/use IE Watch? I will also try the blocking method as well, I just want to try to get this to work.

Re: Error with wodhttp

by woddrazen, Friday, November 21, 2008, 23:29 (5845 days ago) @ celtik

Celtik,


You can download evaluation version of IEWach from IEWatch website (iewatch.com).

Here is some code that will show you how you should use wodHttpDLX in blocking mode:
[code]Set http1 = New wodHttpDLXCom
Dim i As Integer

http1.Blocking = True
http1.Get http://login.myspace.com/index.cfm?fuseaction=login.process

For i = 0 To http1.Response.Cookies.Count - 1
http1.Request.Cookies.Add http1.Response.Cookies(i).Name, http1.Response.Cookies(i).Value
Next i

http1.Request.FormPost.Add email , Text1.Text
http1.Request.FormPost.Add password , Text2.Text
http1.Request.FormPost.Add Remember , Remember
http1.Request.FormPost.Add Loginbutton , Login
...

http1.Post http://login.myspace.com/index.cfm?fuseaction=login.process

http1.Get new url after you are connected to server [/code]
Remember this is just example. I'm not sure that this will work as is with your server.


Drazen

Re: Error with wodhttp

by celtik, Saturday, November 22, 2008, 05:15 (5845 days ago) @ woddrazen

Oh OK, I see what IE Watch is now. It is kind of the same thing as the firefox add on I use, Live HTTP Headers. The blocking method looks much easier, I may try that out. Also, is there some sort of specific sample or something dealing with multisocketing wodHttp?

Re: Error with wodhttp

by woddrazen, Saturday, November 22, 2008, 12:06 (5844 days ago) @ celtik

Celtik,


You can use multiple instance of wodHttpDLX if you have that in mind.

There is no special cod for that. Just declare new wodHttpDLX instance and add some code for that instance. This is all.


Drazen

Re: Error with wodhttp

by celtik, Saturday, November 22, 2008, 12:33 (5844 days ago) @ woddrazen

Alright. I mean with like 10+, but I should be able to just use a simple for loop. Thank you for the help.