Building Real-time Web Apps with ASP.NET WebAPI and WebSockets

WebSocket is a recent technology that provides two-way communication over a TCP connection. This allows us to create real-time web apps where servers can push data to clients. In this blog post, I’ll demonstrate how this can be done by building a simple chat app using ASP.NET WebAPI and ASP.NET’s new support for WebSockets in…


Error Handling in ASP.NET WebAPI

WebAPI is a brand new framework that makes it easy to build HTTP services. As such, it provides several features that make it easy to send back useful and informative error messages in a variety of cases. In this post, I’ll go over some of these capabilities. Note: Not all of the features I mention…


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:….