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

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

Facets Developer
Source: Cognizant
Details: We are looking for a Facets Developer in Dayton, OH Job Roles/Responsibilities Candidate should have good working experience on Web services/WCF  More
14 days ago

Dayton, OH 11-August-2016

.net developer
Source: Diverse Lynx
Details: Hand on exp in development with ASP .NET, MVC and SQL Server 2012. Requirement gathering, creation on HLD/LLD, Development and co-ordination with offshore and...  More
20 hours ago

Pennington, NJ 25-August-2016

.Net Developer
Source: Diverse Lynx
Details: .Net Technologies .Net Framework 2.0/3.0/3.5/4.0/4.5, ADO.Net, Entity ,LINQ ,Web Services, Web Forms, Win Forms, AJAX,ASP.NET MVC, SharePoint, WCF, WPF....  More
30+ days ago

Florence, KY 08-July-2016

Application Developer (San Francisco)
Source: BookKeeping Express
Details: C# WebAPI ASP.NET MVC. Prior experience with SQL, ASP.NET MVC, Angular or similar, SQL. BookKeeping Express (BKE) provides a SaaS platform which automates...  More
1 day ago

San Francisco, CA 24-August-2016

Interactive Freelancers - .NET Application Developer
Source: MMGY Global
Details: Ability to create a new website and maintain an existing site using ASP.NET web frameworks (for example, Web Forms, ASP.NET MVC)....  More
2 days ago

Kansas City, MO 64112 23-August-2016

Application Developer - US or Green Card
Source: Indeed
Details: 4 or more years of experience with MVC using Visual Studio. C#, asp.net, mvc, entity framework, ms sql, jquery, n-tier, sdlc, web services, angularjs, ado.net,:...  More
8 hours ago

Lafayette, CO 25-August-2016

.Net Developer - Jr-Mid Level
Source: Indeed
Details: .Net, ASP.NET, MVC, jQuery, Build. Strong Web Development experience developing web applications in ASP.NET, MVC, MVVM, AJAX, Java Script patterns, .Net Web API...  More
6 days ago

Washington, DC 19-August-2016

.NET Application Developer-Mid Level
Source: Indeed
Details: Knowledge of ASP.NET MVC. TFS, WCF, ASP.NET MVC, NUnit Unit, SOA:. .NET Application Developer-Mid Level....  More
7 days ago

Rockville, MD 18-August-2016

Mid Level C#/.Net Application Developer
Source: Indeed
Details: We are working closely with an employee friendly SaaS Software company who is seeking a C#/.Net Developer. Their environment is .net and they are a unique  More
8 days ago

Jericho, NY 11753 17-August-2016

Senior Software Engineer
Source: Microsoft
Details: The Microsoft Support Engineering Group (MSEG) is a key organization within the Universal Store Team. MSEG is chartered with reimagining and transforming the  More
2 days ago

Redmond, WA 98052 23-August-2016

.NET/MVC Developer (F/T)
Source: XDuce
Details: Strong Experience on MVC. Web Developer - .NET and MVC & Angular.js/Node.js. Expert knowledge of the Microsoft technologies, including .NET, ASP.NET, MVC, MS...  More
15 days ago

New York State 10-August-2016

Cloud Application Developer - UI/Front End/Angular
Source: Indeed
Details: Experience with Web application technologies, Asp.Net Web forms, Asp.Net MVC, HTML, CSS, JavaScript and JQuery - Angular2/TypeScript....  More
13 days ago

Boise, ID 83713 12-August-2016

.Net Developer
Source: Cognizant
Details: Asp.Net MVC 5.0. Provide data to senior team members during consulting engagements....  More
30+ days ago

Long Beach, CA 20-July-2016

.Net Developer
Source: Diverse Lynx
Details: .Net Technologies .Net Framework 2.0/3.0/3.5/4.0/4.5, ADO.Net, Entity ,LINQ ,Web Services, Web Forms, Win Forms, AJAX,ASP.NET MVC, SharePoint, WCF, WPF....  More
30+ days ago

Pittsburgh, PA 15219 30-June-2016

Dot net developer with Angular
Source: Diverse Lynx
Details: " Minimum of 7 years of development experience with ASP.NET MVC; " 5 or more years of JavaScript, JQuery, HTML, CSS experience....  More
22 days ago

Eden Prairie, MN 03-August-2016

.Net Developer
Source: Diverse Lynx
Details: Full stack .NET developer Must have: Extensive UI development, Javascripting background (Angular JS, React, Node.JS) C# asp.net mvc sqlserver soa/wcf...  More
30+ days ago

New York, NY 02-July-2016

Mid Level .Net Web Developer
Source: The Rock Creek Group
Details: You will be working on applications written using ASP.NET, MVC and SQL Server. We are looking for candidates within the local region....  More
21 days ago

Washington, DC 20036 04-August-2016

.net application developer(Need F2F)
Source: Indeed
Details: Hello , Please go through the below requirement if you are interested send me your updated resume ASAP. *TITLE: .NET APPLICATION DEVELOPER* *DURATION: 6 Months  More
1 day ago

Playa Vista, CA 24-August-2016

Sr. SQL Server Developer ( Federal Contract)
Source: Indeed
Details: 5.2.5 Working knowledge of ASP.NET MVC Framework 5 years. Technical Skill Set Requirement....  More
2 days ago

Jackson, MS 23-August-2016

.NET Web Developer
Source: Marcel Digital
Details: Develop on the ASP.NET MVC stack (including Umbraco). Marcel Digital, an award winning interactive marketing agency established in 2003 and located in the River...  More
30+ days ago

Chicago, IL 60654 04-June-2016

C#.NET Developer
Source: Pointwest Technologies Corp
Details: Experience with web services, REST, JSON, SOAP, XML, ASP.NET MVC. The C#.Net developer participates in all stages of development of several applications within...  More
8 days ago

Chesterbrook, PA 19087 17-August-2016

.NET Web Developer with Signal-R
Source: Pointwest Technologies Corp
Details: 4-5 Years of experience in ASP.NET MVC. The .Net web developer participates in all stages of development of several applications within the enterprise....  More
8 days ago

Chesterbrook, PA 19087 17-August-2016

.NET Web Developer
Source: Pointwest Technologies Corp
Details: 4-5 Years of experience as a .NET developer using ASP.NET MVC. The .Net web developer participates in all stages of development of several applications within...  More
8 days ago

Chesterbrook, PA 19087 17-August-2016

Web Application Developer
Source: Indeed
Details: Experience with the Microsoft web stack including SQL server, entity framework and ASP.NET, MVC. We are working with a fantastic company in the Hartford area...  More
28 days ago

Tolland, CT 28-July-2016

Front End Developer
Source: All Lines/LANtek
Details: 1-3 years’ experience with ASP.NET MVC and C#. All Lines/LANtek is seeking a Front End Web Developer....  More
30+ days ago

Township of Cranberry, PA 16066 11-July-2016
Category: ASP.NET ASP.NET Web API Tags:

About IMRAN ABDUL GHANI

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.