A Practical Guide to ASP.NET Web API

By | February 17, 2014

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 Tutorial for Creating your First SPA Application using AngularJS and Web API having all CRUD Operations.

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
  • 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.

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]


Web Developer
Source: Microsoft
Details: Full Stack Web Developer The Microsoft.com team is seeking a full stack web developer with a focus on front-end and user experience development. If this is...  More
8 days ago

Redmond, WA 98052 16-June-2016

Web Developer/Code Poet (C#, AspMvc, Polymer)
Source: Indeed
Details: Junior to Intermediate C#, ASP.net, MVC, SQL Server and a desire to learn. We are a progressive startup software company in Irving, TX looking for C# / ASP.MVC...  More
23 hours ago

Irving, TX 24-June-2016

C# Senior Developer
Source: Indeed
Details: *Skill Set* C# Senior Developer *Work Location* Charlotte, NC, USA *Job Description* ­Tech requirements: 5+ years of experience in .NET application...  More
2 days ago

Charlotte, NC 22-June-2016

C# with Dotnet / WCF Senior Developer
Source: Cognizant
Details: ASP.Net Web API, Razor, MVC. Core C#, .Net 4.5+, Very Strong Object Oriented Programming skills, WCF, REST services, ASP.Net 4.5+....  More
4 days ago

Hartford, CT 21-June-2016

Web Developer
Source: The Mosaic Company
Details: The candidate must have experience with React, Javascript, Typescript, Azure cloud app development, HTML, LESS and ASP.NET MVC....  More
2 days ago

San Ramon, CA 94583 22-June-2016

Web Developer/Architect
Source: Indeed
Details: ASP .NET MVC including the Entity Framework. In this role you will:....  More
3 days ago

Fort Wayne, IN 46825 22-June-2016

Web Developer
Source: Indeed
Details: The candidate must have experience with React, Javascript, Typescript, Azure cloud app development, HTML, LESS and ASP.NET MVC....  More
3 days ago

Renton, WA 98057 22-June-2016

IT - Web Developer
Source: Indeed
Details: Minimum of 7 years of development experience with ASP.NET MVC; Please go thru the requirement and let me know if you would be interested, if so please share...  More
3 days ago

Eden Prairie, MN 21-June-2016

Microsoft Web Developer - Managed Services
Source: Rightpoint
Details: Create web user interface server-side functionality using ASP.NET Web Forms, ASP.NET MVC, Sitecore, and SharePoint....  More
3 days ago

Chicago, IL 21-June-2016

Web Developer
Source: SS&C GlobeOp
Details: Have worked with ASP.NET, MVC. ABOUT SS&C TECHNOLOGIES:....  More
4 days ago

Sandy Hook, CT 21-June-2016

Full Stack Web Developer
Source: Timmons Group
Details: Experience with ASP .NET MVC. Timmons Group is a multi-disciplined engineering and technology firm recognized nationally as a “Best Firm to Work For” by CE News...  More
4 days ago

Richmond, VA 21-June-2016

Full Stack Web Developer
Source: Timmons Group
Details: Experience with ASP .NET MVC. Timmons Group is a multi-disciplined engineering and technology firm recognized nationally as a “Best Firm to Work For” by CE News...  More
4 days ago

Raleigh, NC 21-June-2016

Full Stack Web Developer
Source: Timmons Group
Details: Experience with ASP .NET MVC. Timmons Group is a multi-disciplined engineering and technology firm recognized nationally as a “Best Firm to Work For” by CE News...  More
4 days ago

Charlotte, NC 21-June-2016

Web Developer (Contractual)
Source: State of Maryland
Details: Three additional years of web development experience using .Net Framework 4.0 or above and MS MVC can be substituted for the educational requirements....  More
5 days ago

Maryland 20-June-2016

Web Developer
Source: Inficare
Details: Software developer with proven experience in C#, ASP.NET, MVC, SQL, web application development. This is a UI and Backend – Web development position who has...  More
30 days ago

Redmond, WA 26-May-2016

Web developer_MF
Source: GlobalLogic, Inc.
Details: MVC, Node.js, PHP. Familiarity with MVC frameworks/patterns. 3-5 years experience....  More
19 days ago

Redmond, WA 06-June-2016

Web Developer - Remote/Work from home opportunity
Source: Food Services of America
Details: Strong understanding of ASP.NET MVC. 3+ years experience with ASP.NET Forms and ASP.NET MVC. For our web development efforts we create new applications using...  More
7 days ago

Remote 18-June-2016

Microsoft CRM and Web Developer
Source: Indeed
Details: 3+ years of Dynamics CRM Development Experience • 5+ years ASP.NET, MVC & WCF Development experience (.NET Framework 4.5 or newer) • Experience and familiarity...  More
7 days ago

Denver, CO 17-June-2016

Web Developer
Source: Indeed
Details: Further consideration will be given to applicants with experience in mobile development and/or knowledge of the Microsoft web technology stack (Visual Studio, C...  More
9 days ago

Peabody, MA 01960 16-June-2016

Source: Indeed
Details: The ideal candidate for this position must have 3 years program experience using C#, ASP.NET MVC, or Angular.JS....  More
3 days ago

Overland Park, KS 22-June-2016

.NET Programmer/Analyst
Source: Indeed
Details: *Title: * .NET Programmer/Analyst *Location: * San Juan, PR *Phone: * 1-787-729-7597 www.thecervantesgroup.com *Role Description: * Developer for full time...  More
4 days ago

San Juan, PR 00908 21-June-2016

Front End Web Developer
Source: Catapult Systems Inc
Details: Experience with ASP.NET MVC framewore. High performing team members....  More
9 days ago

Austin, TX 78746 15-June-2016

Information Systems Specialist 6 - Web Developer/Analyst (ODOT16-1245oc)
Source: State of Oregon
Details: MVC. We invite members of all diverse communities to join our workforce as we endeavor to best serve Oregonians from every background....  More
9 days ago

Salem, OR 15-June-2016

Jr Web Developer
Source: Collette Travel Service
Details: •.Net technologies (C#, ASP.NET, ASP MVC) •Has experience working with a CMS •Thorough understanding of HTML and the Document Object Model •Experience with...  More
10 days ago

Boston, MA 15-June-2016

Programmer Analyst I
Source: Concord Group Insurance
Details: Web/Windows services, ASP.Net MVC, HTML5, CSS, and JavaScript. Since 1928 The Concord Group Insurance Company has been protecting the interests of residents and...  More
4 days ago

Concord, NH 03301 21-June-2016
Category: ASP.NET ASP.NET Web API Tags:


Imran Abdul Ghani is working as Software Developer(Senior) with extensive knowledge in Web development technologies especially C#, ASP.NET, MVC, WCF, Web API, ADO.NET Entity Framework, jQuery etc. He has several years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET (MCSD.NET) since 2005. You can reach his blogging at www.webdevelopmenthelp.net, www.topwcftutorials.net, and www.sharepointfordummies.net.