Writing a Lightweight Web Service using WebApi Building Blocks

Don’t you wish you could write a web service this easily:   LiteWebServer server = new LiteWebServer(“http://localhost”); server.Get(“/Hello”, (r) => new HttpResponseMessage() { Content = new StringContent(“Hello World!”) }); server.Post(“/Echo”, (r) => new HttpResponseMessage() { Content = new StringContent(r.Content.ReadAsStringAsync().Result) }); server.Open();   Well, with last week’s release of the Web API beta bits, now you can. Web API is a brand new framework that makes it easy to build HTTP services. You can learn more about Web API here: http://www.asp.net/web-api….