Software development industry analysis by Larry O'Brien, the former editor of Software Development and Computer Language
Monday, September 29, 2003

Has anyone programmed Radio Userland using C# or VB.NET? I don't want to get involved in religious wars about blogging APIs, all I want is an example that shows how to create a blog post using .NET objects like HttpWebRequests. My first attempt just timed out and Google isn't helping me, even though I know this should be trivial:

string xml = "<methodCall><methodName>metaWeblog.newPost</methodName><params><param><value>blogId</value></param><param><value>user</value></param><param><value>pass</value></param><param><value><item><title>foo</title><description>stuff</description></item></value></param><param><value>true</value></param></params></methodCall>";

XmlDocument doc = new XmlDocument();

doc.LoadXml(xml);

HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create("http://localhost:5335/RPC2/");

req.Method = "POST";

req.Timeout = 15000;

HttpWebResponse res = (HttpWebResponse) req.GetResponse();

StreamReader sr = new StreamReader(res.GetResponseStream());

textBox1.Text = sr.ReadToEnd();

Monday, September 29, 2003 11:18:45 AM (Hawaiian Standard Time, UTC-10:00) |  Disqus link  | #
Search
About Larry...
Flickr photostream
Subscribe: RSS 2.0 Atom 1.0
Popular Articles
Programming Sabre with Java, C#, and XML
Genetic Programming in C#
15 Exercises To Know A Programming Language
Top 10 Things I've Learned About Computers From the Movies and Any Episode of "24"
Recently Published Articles
HI
KonaKoder
Categories
Archive
Admin Login
Sign In
Toolroll