?

Log in

No account? Create an account
Help With VB - LiveJournal Client Discussions — LiveJournal [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:
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)