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


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


Other Related Articles:

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]

Top ASP.NET MVC Jobs

Web Developer
Source: Indeed
Details: Have worked with the .NET web stack including ASP.NET, MVC, WebAPI 2 and C#. We are seeking a driven, innovative and detail-obsessed software developer who...  More
22 hours ago

Bellevue, WA 06-December-2016

Web Developer (C# & AngularJS) -2 months of contract
Source: CSI Interfusion Inc
Details: Solid skills on C#, ASP.Net, MVC, JavaScript, CSS, HTML, etc. CS I Interfusion ( CSI ) (size:....  More
5 days ago

Redmond, WA 02-December-2016

Backend Web Developer
Source: Indeed
Details: Minimum 4 years experience with writing WinAPI/RESTFul API and working in an ASP.NET MVC environment. Keyventer is seeking a *Back End Web*....  More
8 days ago

Seattle, WA 28-November-2016

Web Developer (C# & AngularJS) - 2 months
Source: Indeed
Details: *CS* *I Interfusion* ( *CSI* ) (size: 20,001+ employees, globally), a leading global provider of *IT consulting services, technical services* and *outsourcing...  More
14 days ago

Redmond, WA 23-November-2016

Programmer / Analyst
Source: Intel
Details: Advanced forms with dynamic connection to stored procedures on other databases - Experience in database design and data modeling - Experience with developing...  More
5 days ago

Hillsboro, OR 97124 02-December-2016

Programmer Analyst
Source: AIG
Details: Strong knowledge of .Net Framework, C#, ASP.Net, MVC, LINQ, Visual Studio 2008/2010/2013 and Version Control System (TFS, Git etc.)....  More
30+ days ago

Jeffersonville, IN 16-September-2016

Web Application Developer
Source: Indeed
Details: ASP.NET MVC, Web Forms, Web API. SC Strategic Solutions is looking for passionate full time software developers who are efficient problem solvers with a...  More
14 days ago

Norwalk, OH 23-November-2016

Web Developer
Source: Indeed
Details: MVC:. ASP.Net MVC and C#.Net experience a must*. ~~~~~NOT A REMOTE POSITION~~~~~*....  More
14 days ago

Sarasota, FL 34232 23-November-2016

Front End Developer | Web Mobile
Source: Specialists On Call
Details: AngularJS, HTML5, Sass, C#, ASP.Net MVC, SOA. Specialists On Call, Inc....  More
15 days ago

Reston, VA 20190 21-November-2016

Microsoft web developer - Contract - Telecommuting
Source: Indeed
Details: MVC, .Net, CSS, HTML:. Working familiarity with ASP.net, MVC. This is a 3 months + contract position for our direct client based in San Antonio....  More
18 days ago

San Antonio, TX 19-November-2016

.NET Developer Instructor
Source: Indeed
Details: NET – You are comfortable working with ASP.NET, MVC and Core Web API. About Coder Camps:....  More
19 hours ago

Redmond, WA 07-December-2016

e-Commerce Web Developer
Source: Indeed
Details: Hands-on code development experience in web development field using ASP.NET MVC, C#, HTML 5.0, jQuery, XML, CSS, and Web Services....  More
21 days ago

South Saint Paul, MN 55075 16-November-2016

Back-End Web Developer
Source: DNTG Software
Details: Experiences with ASP.NET and MVC in C#, Web API. Develop and maintain secure and stateless web services using Microsoft ASP.NET MVC 4.0 based on the REST...  More
21 days ago

Buena Park, CA 16-November-2016

Web & Mobile Developer
Source: Indeed
Details: Our software stack includes Xamarin C# on iOS & Android, ASP.NET MVC, Microsoft Azure, Angular.js, HTML5, and JavaScript....  More
21 days ago

Kent, WA 15-November-2016

.Net Developer with Azure Cloud Experience
Source: CSI Interfusion Inc
Details: Demonstrated experience working on services built using ASP.NET / MVC, and SQL db. CSI Interfusion (CSI) (size:....  More
5 days ago

Redmond, WA 02-December-2016

Senior Software Engineer
Source: Clarity Consulting Inc.
Details: C# / WinRT / .NET / XAML / Windows 8/8.1 / Windows Phone 8/8.1 / Xbox / UCMA/UCWA / iOS / Cocoa Objective-C / Android / Xamarin / HTML5 / JavaScript/jQuery /...  More
1 day ago

Seattle, WA 06-December-2016

.Net Developer
Source: Indeed
Details: .Strong Experience developing MVC applications using ASP.Net MVC. .4+ years experience in software engineering....  More
7 days ago

Redmond, WA 30-November-2016

Web Developer
Source: Indeed
Details: Experience with ASP.NET MVC is a plus. R+L Carriers is currently seeking a Web Application Developer for our Ocala, FL Technical Center and our Wilmington, OH...  More
29 days ago

Wilmington, OH 45177 08-November-2016

.Net Developer
Source: Indeed
Details: .Strong Experience developing MVC applications using ASP.Net MVC. Essential Job Functions....  More
41 minutes ago

Seattle, WA 07-December-2016

Front-End Web Developer
Source: Indeed
Details: Experience with the MS development stack Visual Studio, .NET, ASP.NET MVC, etc. Crystal Capital Partners, a financial services company w/ over 20 years of...  More
30+ days ago

Miami, FL 04-November-2016

Web Applications Developer
Source: ITR (Information Technology Resources)
Details: Experience with the MVC pattern and responsive design of web applications. Web Applications Developer....  More
30+ days ago

Oak Ridge, TN 02-November-2016

Web Developer
Source: Indeed
Details: Experience with ASP.NET MVC is a plus. R+L Carriers is currently seeking a Web Application Developer for our Ocala, FL Technical Center and our Wilmington, OH...  More
29 days ago

Ocala, FL 08-November-2016

Senior Developer
Source: Indeed
Details: .NET architecture, ASP.NET MVC, OOP, SOA, repository patterns (CRUD). Development, maintenance and administration as part of a team supporting advanced...  More
2 hours ago

New York, NY 07-December-2016

Senior Software Developer
Source: MediaRadar
Details: Knowledge of ASP.NET MVC 4/5. Web based projects will center on ASP.Net MVC 4 and the Razor view engine, with Angular.js....  More
20 days ago

New York, NY 17-November-2016

Programmer Analyst
Source: Kindred Healthcare
Details: Have experience with ASP.NET MVC and/or WPF. Clinical Systems Development....  More
19 days ago

Louisville, KY 40202 18-November-2016
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest
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.