I am trying to upload video to WordPress.using following method
string expression = videoData.VideoTitle;
string str7 = videoData.VideoTitle;
WebClient client = new WebClient();
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
string s = "security_code=JGZpbGVu&post_content=<iframe width='480' height='390' src='http://www.youtube.com/embed/XkIdmC8MlkI' frameborder='0' allowfullscreen></iframe>"
+ "&post_title=" + expression + "&post_category="
+ "&post_category=" + category + "&category=" + category + "&post_name=" + str7 + "&post_date=" + DATE_STRING;
byte[] bytes = Encoding.ASCII.GetBytes(s);
byte[] buffer2 = client.UploadData(uploadPath, "POST", bytes);
string str8 = Encoding.ASCII.GetString(buffer2).ToString();
it works and everything is posted but the thing in tags does not get posted i tried some couple of things what turned out is that it had problems with tag.
when i remove < of iframetag it is displayed but till url and after that everything is gone.
here is the thing which does not performs well
"security_code=JGZpbGVu&post_content=test iframe width='480' height='390' src='http://www.youtube.com/embed/XkIdmC8MlkI' frameborder='0' allowfullscreen></iframe>&post_title=How to build, upgrade, or repair, your own PC Computer&post_category=&post_category=asd&category=asd&post_name=How to build, upgrade, or repair, your own PC Computer&post_date=2011-05-11 00:00:00"
any idea what is wrong?
You’ll probably need to URL-encode the HTML.
Make sure you reference System.Web, then: