||[Mar. 27th, 2002|01:58 pm]
LiveJournal Client Discussions
I'm trying something as simple as...|
mode=login&user=jingoro&password= . . .
And it keeps telling me Invalid Password. (I've checked that I'm using my correct password a dozen times) Any clues? Must we use hpassword now?
Rumor is there are other protocols than /flat . . . any truth to this? If so, they aren't documented in the developer's area.
Problem solved. I should not send a CRLF pair following the password. Thought I'd tried that, but just tried it again and got some success! Thanks all who put up with me.
If the password contains any characters other than letters and numbers, you must encode them in %hex format. In other words, instead of saying "secret*password", you have to say "secret%2Epassword".
Hope this helps.
No, the password has been properly encoded. Thank you though.
You're absolutely right... works great if I type it in as a URL. That makes it my bad somewhere. Lord knows where. Thank you.
Oh nice... is XMLRPC supported by the real (non-Goathack) LJ server? Is XMLRPC the same as SOAP? Is there a .wsdl description of the interface?
Are any LJ Clients currently in production using this to communicate with the servers?
Which programming language are you using?
I can show you the code I use in my client thingy if you want.
VB.NET with heavy utilization of System.Net for HTTP communications. I'm pretty sure System.Net is !@#$ing with my request.
The relevant code, if anyone's interested:
sBuffer = "mode=login&user=test&password=test"
' Set up request headers
objRequest.Method = "POST"
objRequest.ContentType = "application/x-www-form-urlencoded"
objRequest.ContentLength = sBuffer.Length() + 2
' Write command to request buffer
objStream = objRequest.GetRequestStream
objWriter = New System.IO.StreamWriter(objStream, System.Text.Encoding.ASCII)
' Execute Request
objResponse = objRequest.GetResponse()
The code fails identically whether I use WriteLine (adds CR/LF at the end of the request body) or Write (remove the +2 in the Content Length if you switch to Write in your tests).
I'm such a fool... Write() does solve the problem. I don't know why I had a false-negative when I tested that earlier.
By the way, the content-length should not include the carriage return/linefeed added to the end of the string sent to the server.
It must, however, reflect what is written to the .NET HttpRequest object's buffer... hence, if I write the CRLF by calling WriteLine, it will throw an exception if I don't add two bytes to content length to reflect the extra space.
All this is irrelevant to LJ... you should not use WriteLine, and hence not add two bytes to content length, when contacting LiveJournal as I so humbly have discovered.