Introduction
ASP.NET Web API is a framework for building and consuming HTTP services that can be reached by a broad range of clients including browsers and mobile devices. In this sample we show how you can build web APIs that support browser clients and can be
easily called using jQuery. The sample demonstrates how to implement support for simple CRUD operations (GET, POST, DELETE), client-side and server-side validation, server-side query and also authorization using forms-based authentication.
Requirements
- Visual Studio 2010 SP1, Visual Web Developer 2010 SP1 or Visual Studio 2012
- ASP.NET MVC 4
- Already included with Visual Studio 2012
- IIS 7.5 Express
- SQL Server LocalDB (SqlLocalDB.MSI)
- Included with Visual Studio 2012
- Update 4.0.2 for Microsoft .NET Framework 4 – Design-time Update for Visual Studio 2010 SP1 (KB2544525)
- Required to use LocalDB with Visual Studio 2010 SP1
Description
This sample code is the basis for the following sequence of videos that can be found on the
ASP.NET Web API home page:
- Your First Web API - In this video we show how to create your first web API using the new Web API project template included with ASP.NET MVC 4.
- Getting Data - In this video we add support for getting a list of comments from a web API
- Delete and Update - Here we add support for posting new comments and deleting existing comments.
- Paging and Querying - Next we show two different ways of support query and paging: using custom URI query parameters and also using the built-in support for the OData
query syntax.
- Custom Validation - This video shows how you can enable server-side validation in a web API and process the validation errors on the client using jQuery unobtrusive validation.
- Authorization - Finally, we show how you can enable authorization for your web APIs using the [Authorize] attribute and support forms based authentication
More Information
For more information on ASP.NET Web API and to download and install the framework please visit the
ASP.NET Web API home page.