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 – Full Stack
Source: Indeed
Details: 5-7 years of experience with the Microsoft .NET UI development stack (ASP.NET MVC & WCF). At Upfront, we make every visit valuable for patients and providers....  More
2 days ago

Chicago, IL 13-December-2017

Full-Stack Software Engineer, ASP.NET
Source: Indeed
Details: C#, ASP.NET MVC, Entity Framework, SQL Server. Ideal candidates have demonstrable experience building highly scalable, secure applications leveraging the ASP...  More
30+ days ago

New York, NY 17-October-2017

C# Software Engineer
Source: Indeed
Details: 1+ years of experience with web development with ASP.Net MVC and JavaScript. CRISP - The State of Maryland Health Information Exchange is a regional health...  More
30+ days ago

Columbia, MD 13-September-2017

Software Development Engineer
Source: Indeed
Details: Experience implementing a RESTful API using ASP.NET MVC 4. We are seeking a talented Software Engineer to contribute to the development and maintenance of an...  More
30+ days ago

Des Moines, IA 06-November-2017

Software Development Engineer II - 4071
Source: Indeed
Details: Experience with ASP.NET MVC (especially Razor views and HTML helper extensions). ISoftStone North America is seeking a Software Development Engineer II to join...  More
4 days ago

Redmond, WA 12-December-2017

Software Engineer
Source: Indeed
Details: You will use your technical expertise and problem solving skills to develop a wide variety of operational grade software solutions (i.e., ASP .NET MVC web...  More
10 days ago

Herndon, VA 05-December-2017

Software Engineer
Source: Indeed
Details: Proficiency with ASP.NET MVC, C#, and SQL. Is the leading Digital Health technology company servicing the needs of the emergency and public safety industries....  More
24 days ago

Broomfield, CO 80021 21-November-2017

Software Engineer
Source: Indeed
Details: C#, ASP.NET MVC and/or Java. This position will exercise the applicant’s skills as a software engineer in both the commercial and government space....  More
30+ days ago

Johnstown, PA 15904 19-October-2017

Software Engineer
Source: Indeed
Details: NET, ASP.NET MVC and Razor Syntax. About the Role*....  More
30+ days ago

Columbus, OH 19-October-2017

Software Engineer
Source: Indeed
Details: API first design and SPA applications with Angular, Web API and ASP.NET MVC. NCARB’s Information Systems (IS) Directorate has an opening for a Software Engineer...  More
30+ days ago

Washington, DC 20006 13-October-2017

Software Engineer
Source: Indeed
Details: _Experience with Microsoft .NET C# and ASP.NET, MVC, & Entity Framework_. Intellicheck Mobilisa is a publicly-traded technology company located in Jericho, NY...  More
30+ days ago

Long Island, NY 05-September-2017

Senior .NET Consultant
Source: Indeed
Details: EPE Innovations is a software development and consulting company, with a primary focus on Complex Data Modeling, Data Analytics and Business Intelligence...  More
7 hours ago

Houston, TX 15-December-2017

Senior .NET Consultant
Source: Indeed
Details: ASP .Net MVC.:. Strong knowledge of our core technology stack including n-tiered .Net development, TFS, MVC C# .NET, .NET Entity Framework, WCF web services, MS...  More
1 day ago

Albany, NY 14-December-2017

ASP.NET MVC Web Developer
Source: Indeed
Details: Strong or expert knowledge of C#, JQuery, JavaScript, Knockout JS, ASP.NET MVC, MSSQL. Perform in a key role in the development and enhancement of enterprise...  More
14 days ago

Evanston, IL 01-December-2017

Associate Software Engineer
Source: Indeed
Details: Experience with .NET Framework (ASP.NET, MVC, WinForms). American Healthtech, a growing software technology company, is searching for an *Associate Software...  More
7 days ago

Ridgeland, MS 39157 08-December-2017

Software Engineer Associate
Source: Indeed
Details: Familiarity with Angular, Entity Framework and ASP.NET MVC. 30% Application Development*....  More
15 days ago

Dallas, TX 30-November-2017

Software Engineer I
Source: Indeed
Details: Knowledge and experience with .NET MVC and web-based development. .NET 4 or greater, ASP.NET MVC 4 or greater, javascript frameworks such as JQuery....  More
7 days ago

Ridgeland, MS 39157 08-December-2017

ASP.NET Web Developer
Source: Indeed
Details: C# and ASP.NET MVC programming:. Develop new ASP.net MVC applications conforming to the design specifications provided....  More
30+ days ago

Orlando, FL 08-November-2017

.Net Developer (C#, ASP.Net)
Source: Indeed
Details: 2+ years' experience with ASP.NET MVC, at least 1 year using the 4-4.5 framework. This individual will assist with the development and maintenance of detailed...  More
18 days ago

Nashville, TN 27-November-2017

.Net Developer (C#, ASP.Net)
Source: Indeed
Details: 2+ years' experience with ASP.NET MVC, at least 1 year using the 4-4.5 framework. Proficient working with the following - .NET, C#/VB, SSMS, Object Oriented...  More
18 days ago

Cleveland, OH 27-November-2017

Sr. Software Engineer
Source: Indeed
Details: Experience with ASP.NET MVC. Looking for a highly skilled software engineer to provide technical leadership on its critical communication software suite....  More
8 days ago

Eden Prairie, MN 07-December-2017

Sr. Software Engineer
Source: Indeed
Details: Experience with ASP.NET MVC. Client is looking for a highly skilled software engineer to provide technical leadership on its critical communication software...  More
30 days ago

Eden Prairie, MN 15-November-2017

Sr. Software Engineer
Source: Indeed
Details: Extensive Experience with ASP.NET MVC using C#.NET. We are looking for a Sr....  More
30+ days ago

San Jose, CA 01-November-2017

Sr. Software Engineer
Source: Indeed
Details: Full stack development experience using C#, ASP.Net, MVC, WCF, REST APIs, SQL Server, JavaScript Frameworks, HTML5, CSS3,. Local Candidates Preferred....  More
30+ days ago

Burbank, CA 22-September-2017

Senior .NET Programmer/Analyst - 5+ Yrs Experience - Philadelphia, PA
Source: Marshall Dennehey Warner Coleman & Goggin, P.C.
Details: A minimum of 5 years experience in application design and development using a variety of .NET technologies and languages, including C#, VB.NET, Javascript,...  More
30+ days ago

Philadelphia, PA 26-October-2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest