HttpWebRequest post=(HttpWebRequest)WebRequest.Create(targetUrl);
post.Method = "post";
post.ContentType = "application/x-www-form-urlencoded; charset=utf-8";
String postData = "";
if(url!=null)
postData += "url=" + HttpUtility.UrlEncode(url);
if (blog_name != null)
postData += "&blog_name=" + HttpUtility.UrlEncode(blog_name);
if (title != null)
postData += "&title=" + HttpUtility.UrlEncode(title);
else
postData += "&title=" + HttpUtility.UrlEncode(url);
if (excerpt != null)
postData += "&excerpt=" + HttpUtility.UrlEncode(excerpt);
UTF8Encoding encoding = new UTF8Encoding();
byte[] buff = encoding.GetBytes(postData);
post.ContentLength = buff.Length;
Stream stream = post.GetRequestStream();
stream.Write(buff,0,buff.Length);
stream.Flush();
stream.Close();
post.BeginGetResponse(null,null);
HttpWebResponse rep = (HttpWebResponse)post.GetResponse();
Stream repStream = rep.GetResponseStream();
Encoding enc = Encoding.GetEncoding(rep.CharacterSet);
StreamReader reader = new StreamReader(repStream,enc);
String content = reader.ReadToEnd();