Saturday, January 18, 2014

REST using Microsoft's ASP.NET Web API



Today we'll be talking about REST and how using it can make your HTML applications more responsive.

First a little background about what REST is. REST stands for REpresentational State Transfer. It's basically a software architecture style for exposing server based resources.

  • Uses HTTP methods (verbs) explicitly- GET, POST, PUT, DELETE
  • It's stateless.
  • It exposes directory structure-like URIs.
  • Returns XML, JavaScript Object Notation (JSON), or both.
A typical REST call looks like this:
http://example.com/customer/34456
This URI represents a request for information about a customer with Id 34456.
In our screencast we'll be creating a RESTful application leveraging Microsoft's ASP.NET Web API. ASP.NET Web API is a Microsoft framework that makes it easy to build HTTP services that support a broad range of clients, including browsers and mobile devices.
Our HTML application will utilize JQuery's Ajax capabilities to request data from the server (in our case widget data) and place it into the page without forcing a full page refresh. This type of responsive UI is becoming common place today and is expected from users.
I hope you enjoy the screencast. I plan to do more projects in the future utilizing ASP.NET's Web API.

Here's a link to download the code.

No comments:

Post a Comment