?

Log in

No account? Create an account
Help With VB - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Help With VB [Nov. 15th, 2002|03:19 pm]
LiveJournal Client Discussions
lj_clients
[wspnut]
[mood |confusedconfused]

I'm trying to make a client in VB using the WinSock Control. I've set it up according to the instructions given to me. It says it connects correctly and sends all of the commands, but I never get an answer back from the site becuase of a timeout. Does anybody know how to fix this?
linkReply

Comments:
[User Picture]From: markpasc
2002-11-15 12:45 pm (UTC)
What all are you sending?
(Reply) (Thread)
From: wspnut
2002-11-15 01:30 pm (UTC)

What I'm Sending...

I tried 2 ways:

WS.SendData "POST /Interface/flat HTTP/1.0"
WS.SendData "Host: www.livejournal.com"
WS.SendData "Content-type: application/x-www-form-urlencoded"
WS.SendData "Content-length: 40"
WS.SendData "mode=login&wspnut=test&password=(my password)" & vbCr

and

WS.SendData "mode=login&wspnut=test&password=(my password)" & vbCr

and it timed out on both of them.
(Reply) (Parent) (Thread)
[User Picture]From: benzado
2002-11-15 01:50 pm (UTC)

Re: What I'm Sending...

You need a blank line between the HTTP headers and the body of the message. Also, each header line needs to end with a carriage return AND linefeed. Also, the content-length needs to be exactly the number of bytes in the body. You don't need to end the body with a newline.

I don't know VB, but I'm guessing you need something more like this:

WS.SendData "POST /Interface/flat HTTP/1.0" & vbCrLf
WS.SendData "Host: www.livejournal.com" & vbCrLf
WS.SendData "Content-type: application/x-www-form-urlencoded" & vbCrLf
WS.SendData "Content-length: 40" & vbCrLf & vbCrLf
WS.SendData "mode=login&wspnut=test&password=(my password)"
(Reply) (Parent) (Thread)
[User Picture]From: rdiamond
2002-11-15 01:51 pm (UTC)
You need to send an extra cr after the content-length line to separate the header from the login data.
(Reply) (Thread)
From: wspnut
2002-11-15 02:02 pm (UTC)

Thanks!

Thanks alot! That fixed it!
(Reply) (Thread)
[User Picture]From: flingel
2002-11-19 12:06 pm (UTC)

More VB Winsock Woes

Hi.

I'm at the same point that wspnut was at. I've followed the code above (obviously replacing my details with those in the code) and I get a 404 error and then some HTML code saying the site may be undertaking some maintenence.

I've then also tried:

login&user=flingel&password=(my ever-so secret password)

which seems to be what the protocol wants me to do and I get the same error. I've also tried to enter gibberish usernames and passwords to see if I get another response. Always a 404.

Any ideas?
(Reply) (Thread)