Aaron B. Russell (idigital) wrote in lj_dev,
Aaron B. Russell
idigital
lj_dev

  • Mood:

REALbasic Code

I'm stumped. I can't see what I'm doing wrong. My code (in REALbasic) says this:

Dim Part1,Part2,Part3,Part4,Part5,Part6,Part6Length,WriteThis as String
Dim Part6LengthN as Integer

StatusInfo.Text="Connected. Logging In..."
Part6="mode=login&user="+Username.Text+"&password="+UserPass.Text+"&clientversion=MacOS-EasyJournal/1.0.0"+CHR(10)+CHR(13)
Part6LengthN=Len(Part6)
Part6Length=Str(Part6LengthN)

Part1="POST /cgi-bin/log.cgi HTTP/1.0"+CHR(10)+CHR(13)
Part2="Host: www.livejournal.com"+CHR(10)+CHR(13)
Part3="Content-type: application/x-www-form-urlencoded"+CHR(10)+CHR(13)
Part4="Content-length: "+Part6Length+CHR(10)+CHR(13)
Part5=CHR(10)+CHR(13)
// Part6 already posted


WriteThis=Part1+Part2+Part3+Part4+Part5+Part6
LoginSocket.Write(WriteThis)


Which should tell LiveJournal:

POST /cgi-bin/log.cgi HTTP/1.0
Host: www.livejournal.com
Content-type: application/x-www-form-url-encoded
Content-length: nn

mode=login&user=test&password=test&clientversion=MacOS-EasyJournal/1.0.0


But the LiveJournal server just throws "FAIL: no mode set" back at me. What am I doing wrong?
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 11 comments