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.

UPDATE: If you are interested further on ASP.NET Core and ASP.NET Core Web API, you can follow below:

More Practical Implementations using ASP.NET Web API are:


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

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.

This collection of ASP.NET Web API Tutorial will definitely help developers to understand in more practical way.


Other ASP.NET Web API and Related Articles:

Step forward in 2017: Build in-demand career skills with Coursera

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]

Top ASP.NET MVC Jobs

Software Engineer I
Source: Vertafore
Details: Have developed either single page web applications leveraging modern frameworks (Angular, React) or more traditional multipage websites leveraging ASP.NET MVC...  More
27 days ago

Bothell, WA 98012 21-September-2017

Junior/Mid Level Software Developer
Source: Indeed
Details: ASP.NET MVC (C#). Software developers are the engine behind the design, development, installation, testing and maintenance of software systems....  More
13 hours ago

Kennesaw, GA 17-October-2017

Software Developer
Source: Mosaic Personnel
Details: Strong background in PHP, ASP.Net Web forms, ASP.NET MVC, C#. Why You'll Love This Software Developer Opportunity....  More
1 day ago

Oklahoma City, OK 17-October-2017

Applications Software Engineer - Web Developer Sr
Source: Indeed
Details: 5+ years' programming experience in C#, .NET framework, VB, MVC, EF and WCF. Experience with Web Development ASP.NET, ASP.NET, MVC, HTML5, CSS, JavaScript, AJAX...  More
15 hours ago

Anaheim, CA 17-October-2017

Software Developer
Source: Indeed
Details: Create ASP.NET MVC controllers to access databases. Knowledge of ASP.NET MVC is preferred but not required. Our development environment runs on the Microsoft...  More
4 days ago

Orlando, FL 13-October-2017

Software Developer
Source: SDHR Consulting
Details: .NET Stack experience (C#, ASP.NET MVC, MS SQL Server). Do you have a passion for writing code?...  More
5 days ago

San Diego, CA 13-October-2017

Software Developer / Software Engineer
Source: Natoli Engineering
Details: ASP.net MVC preferred. Software Developer / Software Engineer....  More
6 days ago

Saint Charles, MO 63304 11-October-2017

Software Developer
Source: Evergreen Enterprises
Details: ASP.Net, MVC development skills using MS Visual Studio; About Evergreen Enterprises....  More
6 days ago

Richmond, VA 23225 11-October-2017

Software Developer
Source: Reynolds and Reynolds
Details: Knowledge of .NET framework including C#, ASP.NET, MVC, JavaScript, JQuery, HTML, CSS, web services, XML and SQL....  More
9 days ago

Draper, UT 09-October-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
12 days ago

San Juan, PR 05-October-2017

Software Developer - Medical Billing
Source: SyMed Corporation
Details: Experience with ASP.NET MVC 5, LINQ, Entity Framework 6. Located in the beautiful Napa Valley, SyMed Corporation is a comprehensive medical billing and...  More
13 days ago

Napa, CA 94558 05-October-2017

Software Application Developer
Source: Indeed
Details: Successful candidates will likely have at least 5 years of experience in a professional capacity and a Bachelor’s degree in Computer Science, Information...  More
13 days ago

Los Angeles, CA 04-October-2017

Sr Software Developer
Source: Indeed
Details: C#, ASP.NET MVC. System redesign includes Car Buying, Retail and Scrap operations (using Mobile, MVC Web, WPF, Xamerin tablet interfaces)....  More
13 days ago

Atlanta, GA 30360 04-October-2017

Software Developer - Mid Level
Source: MartinFederal Consulting
Details: ASP.NET MVC and Web Forms. MartinFederal is seeking a self-motivated candidate for our Mid-Level Software Developer position in support of our DoD customer at...  More
16 days ago

Fort Meade, MD 20755 01-October-2017

Software Developer
Source: Gagemaker LP
Details: Intermediate to advanced skills in ASP.NET MVC , ASP.NET Web API. Software Developer Position Summary:....  More
19 days ago

San Antonio, TX 78216 28-September-2017

Software Developer ; Front-end
Source: Indeed
Details: If you are passionate about technology and enjoy creating simple solutions to complex requirements -- come join us! We are looking for topnotch developers...  More
20 days ago

San Diego, CA 27-September-2017

Software Developer 3
Source: Almac Group, Inc
Details: Minimum 2 years of experience developing applications utilizing ASP.net MVC and C#. 3 or more years of C# and ASP.net MVC experience working in a regulated...  More
27 days ago

Durham, NC 27704 20-September-2017

Software Developer
Source: Indeed
Details: Expertise should include HTML5, AngularJS, JavaScript, ASP.NET MVC and CSS. A solid understanding of working with MVC JavaScript frameworks such as Angular....  More
28 days ago

Carlsbad, CA 20-September-2017

Software Developer
Source: Indeed
Details: ASP.NET MVC, Web API. NET Framework 4.0 and above. Software Developer (.NET)*....  More
28 days ago

San Diego, CA 19-September-2017

Software Developer
Source: Indeed
Details: Experience with ASP.NET MVC and Web API. Client Resources Inc....  More
29 days ago

Lincoln, NE 18-September-2017

Software Developer
Source: Indeed
Details: 3+ years of experience with C# and ASP.NET MVC. The Software Developer will assist with new and ongoing software development as a member of an agile team...  More
22 days ago

Kennesaw, GA 25-September-2017

Software Developer 2
Source: Almac Group, Inc
Details: Minimum 1 year of experience developing applications utilizing ASP.net MVC and C#. Almac is an exceptional, award winning, drug development solutions provider...  More
29 days ago

Audubon, PA 19403 18-September-2017

Software Developer 2
Source: Almac Group, Inc
Details: Minimum 1 year of experience developing applications utilizing ASP.net MVC and C#. Almac is an exceptional, award winning, drug development solutions provider...  More
30+ days ago

Lansdale, PA 19446 14-September-2017

Software Engineer/Developer
Source: ITR (Information Technology Resources)
Details: Candidates demonstrating applied experience with ASP.NET MVC, Java, and Linux will be given extra consideration....  More
30+ days ago

Oak Ridge, TN 07-September-2017

Software Engineer/Developer
Source: ITR (Information Technology Resources)
Details: The qualified candidate will be responsible for development and coding Web and desktop applications in the .NET Framework, SQL Server, and ASP.NET MVC....  More
30+ days ago

Knoxville, TN 04-September-2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest