A Practical Guide to ASP.NET Web API

By | February 17, 2014
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest

Microsoft ASP.NET Web API framework is the best choice for developing HTTP services in more simpler way. It enables us to reach more wider ranger of clients such as browsers as well as mobile devices.In one of my previous web development tutorial about building RESTful service, I explained that the purpose of HTTP is not just acting as a transport layer (for example, in case of SOAP-based WCF service). However, its a very mature platform for developing Web APIs and utilizing its old simple concepts such as HTTP methods, HTTP status codes and URIs etc.


Note: You can download a PDF version of the same “A Practical Guide to ASP.NET Web API” here.


So, we can say that using ASP.NET Web API, we can create HTTP services

  • those are non-SOAP based like plain XML or JSON string.
  • using full features of HTTP.
  • reaching broader range of clients (browsers and mobile devices).

You can find recent ASP.NET Web API Tutorials:

Following is the typical ASP.NET Web API processing architecture.

ASP.NET Web API Service
You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to moderate a comment. Which HTTP verb should you use?

  • A. GET
  • B. POST
  • C. DELETE
  • D. PUT

To further test your ASP.NET Web API skill, Take a Complete FREE Online Test or MCSD Practice Exam: 70-486 (Developing ASP.NET MVC Web Applications). Simply Click Here.

 Correct Answer: D

Lets move forward to implement all the above mentioned related features step by step.

Foundation – HTTP & REST Concepts

  • Resources and URIs
  • HTTP Methods
  • HTTP Status Codes
  • HTTP Content
  • Internet Media Types
  • REST
  • JSON & XML

Chapter 1:- Developing your first ASP.NET Web API service
In chapter 1, we will be creating a simple HTTP service using Web API. A step by step approach is used while developing the service and getting results as:

  • Creating a Web API Project in Visual Studio
  • Preparing a Domain Model
  • Adding Controller
  • Finally testing results in browser.

Chapter 2:- Performing CRUD operations using ASP.NET Web API service – Part 1
As chapter 1 only focuses getting records using HTTP GET verb only, this chapter provides complete detail understanding of all CRUD (Create, Retrieve, Update, Delete) operations using Web API. Discussion about all related HTTP verbs i.e. GET, PUT, POST, DELETE is provided.

Chapter 3:- Performing CRUD operations using ASP.NET Web API service – Part 2
As we have already developed Web API service in previous chapter, here in this chapter, we will be consuming already created HTTP service using jQuery. Complete code snippet of jQuery for consuming a Web API service is given with detailed understanding of jQuery AJAX call.

Chapter 4:- What’s new in ASP.NET Web API 2
Web API version 2 is released and this chapter briefly overview the top new features of ASP.NET Web API i.e.

  • Attribute Routing
  • Cross Origin Resource Sharing
  • Open Web Interface for .NET
  • IHttpActionResult
  • Web API OData
Chapter 5:- Model Validation in ASP.NET
Model in MVC framework is a representation of data structure. This Web API Tutorial focuses to understand and implement the data annotation technique for applying validation on a model class for an ASP.NET Web API application.

Chapter 6:- Exception Handling in ASP.NET Web API – Part 1
This chapter discusses about Exception Handling in ASP.NET Web API service. Instead of returning a generic status code i.e. 500 (Internal Server Error), a valid and meaning result should be sent back to client using HttpResponseException type.

Chapter 7:- Exception Handling in ASP.NET Web API – Part 2
To achieve the same purpose, as discussed in previous chapter, for more advanced scenarios: Web API provide Exception Fitlers and focus of the chapter is how to create an Exception Filter and return meaningful response.

Chapter 8:- ASP.NET Web API OData 5.3
Discussing in detail about features of Microsoft ASP.NET Web API OData 5.3 and 5.3.1 beta including:

  • Open Entity Type Support
  • Major Bug Fixes
  • Dynamic Collection Property in Open Type
  • More about flexibility to use $levels and $expand queries
  • Utilizing OData Core Libraries.

Extras:- Top 10 ASP.NET Web API Interview Questions
For a detailed and comprehensive list of Top 10 most important Interview Questions for Microsoft ASP.NET Web API that every Web Developer MUST Know.

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]

Top ASP.NET MVC Jobs

Developer, C#, .NET, MVC
Source: Logic20/20
Details: Developer, C#, .NET, MVC. C#, .NET framework (ASP.NET MVC, Entity Framework). Solid knowledge of C#, .NET framework (ASP.NET MVC, Entity Framework)....  More
13 days ago

Seattle, WA 98115 13-June-2017

Dot Net Developer
Source: Indeed
Details: ASP.NET MVC, JQuery, Entity framework, HTML programming. Develop enterprise web or desktop applications using *Microsoft .NET, ASP.NET, C#, application...  More
18 days ago

Redmond, WA 07-June-2017

Principal Engineer
Source: Indeed
Details: C#, .NET, ASP.NET MVC, WCF, Rest, WebAPI, HTML5, AJAX, JSON, JQuery, ServiceBus, RabbitMQ, TeamCity and similar....  More
30+ days ago

Austin, TX 22-May-2017

ASP.NET MVC Web Developer
Source: Cardinal Intellectual Property, Inc
Details: ASP.NET MVC Web Developer. Strong or expert knowledge of C#, JQuery, JavaScript, Knockout JS, ASP.NET MVC, MSSQL....  More
2 days ago

Evanston, IL 23-June-2017

Senior .Net Developer
Source: Indeed
Details: Sitecore (including Helix and MVC), C#/.NET, ASP.NET MVC, NPM, jQuery, CSS, SASS, GIT & SVN, CI, SQL, DB2, and REST service architecture....  More
4 days ago

Wilton, CT 21-June-2017

.NET MVC Web Developer
Source: R. Watson & Associates, Inc.
Details: Experience with ASP.NET MVC, SQL, HTML and JavaScript at a minimum. We are looking to expand our team by hiring a .NET MVC Web Developer....  More
10 days ago

Talent, OR 16-June-2017

.NET Developer
Source: Inforeem
Details: 3.AngularJS, ASP.NET MVC, JQuery, HTML5. We are looking for strong profiles in .NET/C#, MVC (data Structure, Algorithm), SQL queries....  More
24 days ago

Redmond, WA 02-June-2017

ASP.NET MVC Developer
Source: Net ESolutions Corporation (NETE)
Details: Design and develop new features and/or maintains existing applications developed on ASP.NET MVC. NETE is seeking a highly motivated, flexible, organized, and...  More
23 days ago

McLean, VA 03-June-2017

C# .Net Developer (Locals Only)
Source: Indeed
Details: 3.AngularJS, ASP.NET MVC, JQuery, HTML5. 1.Good in C# and Microsoft .Net....  More
3 days ago

Redmond, WA 22-June-2017

C# .Net Developer
Source: Indeed
Details: Responsibilities include: Rewrite an existing COTs system in accordance with CMS’ Agile XLC framework on site at Security Blvd. Under the guidance of the  More
3 days ago

Windsor Mill, MD 21244 22-June-2017

.Net Developer - Web Services - Web API - SQL
Source: Indeed
Details: 4 to 7+ years experience with software design and development (including the Microsoft application development framework) preferably C#, ASP.Net, ASP.Net MVC....  More
9 days ago

Minneapolis, MN 16-June-2017

Xamarin Dotnet/.Net Developer
Source: Indeed
Details: Strong knowledge and working experience of NET MVC. Solid experience on C#, Xamarin - Xamarin including Xamarin.iOS and Xamarin.Android, JavaScript, Mobile...  More
9 days ago

Miami, FL 16-June-2017

.NET Software Developer Fin Tech
Source: Indeed
Details: Experience with ASP.NET MVC. Would you enjoy working in a cutting edge C# environment and programming with technologies like C# 5.0, MVC 5, ASP.NET Core and...  More
9 days ago

Evanston, IL 16-June-2017

.NET Software Developer - Cambridge, MA
Source: Indeed
Details: Exposure to ASP.NET MVC framework:. Good understanding and exposure to ASP.NET MVC framework. .NET Software Developer....  More
11 days ago

Cambridge, MA 15-June-2017

C# .Net Developer
Source: Indeed
Details: MVC:. Solid understanding of MVC architecture and frameworks. Experience in enterprise web application development using Microsoft technologies(C#, ASP.NET MVC,...  More
12 days ago

Santa Clara, CA 13-June-2017

Software Developer
Source: Indeed
Details: Experience with Asp.net MVC, Razor, .Net Core, Html, CSS, XML, XSLT, XPath, AJAX, Web API (is a plus). Software Developer (Mid-Level)*....  More
3 days ago

Austin, TX 78730 22-June-2017

Software Developer
Source: Indeed
Details: Knowledge in Visual Studio 2005-2013 and .NET Framework 2.0 - 4.5.1, ASP.NET MVC 5.0, VB 6.0/.NET, C, C++, C#, Java, Tomcat, Transact-SQL, HTML, XML, JavaScript...  More
4 days ago

San Juan, PR 21-June-2017

ASP.NET Web Developer
Source: Sandhills Publishing
Details: ASP.Net MVC Framework, Object Oriented Programming, Web Services and RESTful APIs, XML, MS SQL, HTML, CSS, TFS or Version Control familiarity....  More
5 days ago

Lincoln, NE 20-June-2017

Applications Developer 3 - .NET
Source: Metropolitan Council
Details: Experience with any JavaScript based MVC or MVVM framework, such as:. Work in an environment that allows you to have a life outside of work and does NOT require...  More
17 days ago

Minneapolis, MN 08-June-2017

Software Development Engineer - Full Stack - Contract
Source: Neal Analytics
Details: Middle tier (ASP.NET MVC / Java). Familiar with MVC, Entity Framework, ASP.NET. We are supporting a well-known cloud platform for one of the largest software...  More
26 days ago

Redmond, WA 31-May-2017

SQL Lead Developer
Source: Indeed
Details: Understanding of ASP.NET MVC 5 including Bootstrap, Razor views and view models, as well as controllers and models. Are you a SQL Wizard?*....  More
9 days ago

Mooresville, NC 28117 16-June-2017

Junior Software Engineer
Source: Indeed
Details: Oracle 11g (or higher), SQL Server 2012 (or higher), AngularJS framework, HTML/HTML5, ASP.Net / ASP.Net MVC. Responsibilities of the Junior Software Engineer:....  More
2 days ago

Prescott Valley, AZ 86314 23-June-2017

Launch and Range Subject Matter Expert (Software Engineer)
Source: Sigmatech, Inc.
Details: Experience in software development utilizing C#, MVC, JavaScript, .NET., Visual Studio, and SQL. Proficiency in C#, ASP.NET MVC, Web API, MSSQL Server, MySQL,...  More
3 days ago

Colorado Springs, CO 80901 22-June-2017

Software Developer
Source: Indeed
Details: .NET Stack experience (C#, ASP.NET MVC, MS SQL Server). We are seeking a talented and motivated software developer to join our development team....  More
9 days ago

San Diego, CA 16-June-2017

Software Engineer. Net
Source: Indeed
Details: JQuery, SSRS, Design Pattern, ASP.NET MVC, and UML, Microsoft Test Manager. C#, ASP.NET with MVC, SQL Database 2012/2014, and Business Analysis, Report Services...  More
5 days ago

Boca Raton, FL 33487 21-June-2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest