lester111 (lester111) wrote in lj_dev,
lester111
lester111
lj_dev

updating posts

I am using this code from one of the livejournal sample projects in codeproject. the login code works fine and I have access. But the below post code doesnt seem to work. Its possible that the string being passed is incorrect. Can someone shed some light. I am a newbie here and would appreciate your help

string

 

request.UserAgent =

request.Method =

request.Accept =

request.KeepAlive =

request.ContentType =

request.Referer =

request.CookieContainer = cookieContainer;

 

url = string.Format("http://www.livejournal.com/update.bml");HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2";"POST";"text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";true;@"application/x-www-form-urlencoded";string.Format("http://www.livejournal.com/update.bml");// Send the blog data

 

 

request.Method=

 

request.ContentLength = postBuffer.Length;

 

postDataStream.Write(postBuffer,0,postBuffer.Length);

postDataStream.Close();

DateTime dt = DateTime.Now;string postData = string.Format("user=&password=&date_ymd_mm={0}&date_ymd_dd={1}&date_ymd_yyyy={2}&hour={3}&min={4}&subject={5}&event={6}&switched_rte_on=&security=public&event_format=auto&prop_current_music=&prop_current_moodid=&prop_current_mood=&usejournal=&action%3Aupdate=Update+Journal&comment_settings=&prop_opt_screening=", dt.Month, dt.Day, dt.Year, dt.Hour, dt.Minute, aSubject, aBody); "POST";byte [] postBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(postData);Stream postDataStream = request.GetRequestStream();
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 

  • 8 comments