Maybe someone here can straighten me out...or point me to resources that explain the matter a bit more clearly.
I'm using what I found here (Part III. Client/Server Protocol) and here (Tcl socket manual page).
This is the proc I've written, as a test, and it doesn't seem to be getting any response, or, effectively posting to my journal.
This is the most basic attempt just to understand how to use
a) socket
b) the protocol to communicate with the LJ server.
proc ljpost {} {
set chan [socket www.livejournal.com 80]
puts $chan "POST /interface/flat HTTP/1.1\n
Host: www.livejournal.com\n
Content-type: application/x-www-form-urlencoded\n
Content-length: 105\n
\n
mode=postevent&user=tonytraductor&password=******&subject=testing+testing+testing&event=this+is+a+test+post"
close $chan
exit
}
I don't even understand, at this juncture, how to get/read a response from the server.
The only things I've written that have had to communicate with a remote machine have used ssh or ftp,
so, this is completely unfamiliar territory to me.
I don't know, here, if I am misunderstanding how to use tcl socket, or the protocol to communicate with the server.
I know I'm doing something wrong, because this fails to post to my journal (yes, I replace ****** with my actual password).