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.


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

Senior Software Developer
Source: BitTitan
Details: Working with technologies across the Microsoft stack including ASP.NET MVC, LINQ and SQL Server. Who is BitTitan?...  More
24 days ago

Kirkland, WA 02-September-2016

Senior Software Developer
Source: Indeed
Details: The Senior Software Developer must have knowledge of Microsoft technologies, including Microsoft .NET 4.0/4.5, C#, ASP.NET MVC, WebApi, IIS, Entity Framework,...  More
13 days ago

Chesapeake, VA 13-September-2016

Senior Software Developer
Source: Crest Financial
Details: ASP, .NET, MVC. Crest Financial, the fastest growing leasing company in Utah, is growing and looking to hire a new Senior Software Developer....  More
17 days ago

Draper, UT 09-September-2016

Senior Developer
Source: Inuvo, Inc
Details: Experience building and running large scale production web applications using ASP.NET MVC and Web API. Inuvo is looking to hire talented engineers to join a...  More
11 days ago

Little Rock, AR 72201 15-September-2016

C# Developer
Source: Inuvo, Inc
Details: Experience with Agile methodologies, building and running large scale production web applications using ASP.NET MVC and Web API....  More
11 days ago

Little Rock, AR 72201 15-September-2016

Full Stack Developer
Source: Indeed
Details: Develop UI components using technologies such as ASP.NET MVC, JavaScript, React.js, JQuery. 5+ years of experience using web technologies including ASP.NET MVC,...  More
3 days ago

Philadelphia, PA 23-September-2016

Application Developer (Secret Clearance)
Source: Indeed
Details: *Overview* Are you looking for an opportunity to join a growing company that is innovative, cutting edge, and mission centered? Our prestigious technical and  More
1 day ago

Arlington, VA 25-September-2016

Application Developer
Source: Indeed
Details: 3+ years of development experience using Microsoft IIS, C#, ASP.NET, MVC, VB, NET, XML and SQL Server. Jefferson Capital Systems, LLC is an industry-leading...  More
5 days ago

Saint Cloud, MN 56303 21-September-2016

Application Developer
Source: Indeed
Details: ASP.NET, ASP.NET MVC, MS SQL Server, HTML, CSS, JavaScript, C#/VB.NET and Microsoft development stac:. Minimum 3 years’ experience with established development...  More
5 days ago

Miami, FL 21-September-2016

Application Developer
Source: Indeed
Details: Working knowledge of C#, ASP.NET, MVC, and Visual Studio. We have an opening for a dynamic Application Developer who is passionate about what they do and...  More
7 days ago

Cranston, RI 19-September-2016

Application Developer
Source: Indeed
Details: HTTP, AJAX, HTML5, ASP.NET WebForms, ASP.NET MVC, MVVM, JavaScript/jQuery and CSS3. Long term consulting assignment over two years....  More
11 days ago

Phoenix, AZ 15-September-2016

Mobile Application Developer
Source: Indeed
Details: HTTP, AJAX, HTML5, ASP.NET WebForms, ASP.NET MVC, MVVM, JavaScript/jQuery and CSS3. Mobile Application Developer....  More
12 days ago

Phoenix, AZ 14-September-2016

Software Developer
Source: Indeed
Details: ASP.NET MVC experience is required. Build and maintain application functionality for new and existing systems.Participate in all aspects of the software...  More
18 days ago

Rancho Cordova, CA 08-September-2016

Software Developer
Source: Indeed
Details: C#, SQL, HTML, CSS, JSON, JavaScript, ASP.NET Web Forms, ASP.NET MVC, Visual Studio. Does this describe you?*....  More
3 days ago

Miamisburg, OH 45342 23-September-2016

Software Developer (Early Career)
Source: Indeed
Details: Working knowledge of WinForms, MVC, and entity framework. Web Programming experience with JavaScript, Ajax, JQuery, HTML, ASP.NET, MVC, responsive design....  More
4 days ago

Fargo, ND 58104 22-September-2016

Software Developer Internship
Source: Arbiter Sports
Details: 0-1 year software development experience or academic exposure in developing web applications using ASP.NET MVC, C#, SQL Server and Entity Framework....  More
5 days ago

Sandy, UT 84070 21-September-2016

Programmer IV
Source: Indeed
Details: MVC Entity Framework. Reviews, analyzes, and modifies programming systems including encoding, testing, debugging and documenting programs....  More
10 hours ago

Salem, OR 26-September-2016

Software Developer w/experience
Source: Indeed
Details: 1 year ASP.net MVC experience preferred. Some experience developing Web applications using ASP.net MVC. Develop custom applications in Visual Studio’s VB.Net/C#...  More
7 days ago

Louisville, KY 19-September-2016

Junior Developer/Tier II Support
Source: OutMatch
Details: Develop and enhance Web-based and Mobile Web SaaS applications using Microsoft technologies, ASP.NET, ASP.NET MVC, JS libraries and MS SQL Server Databases....  More
13 days ago

Dallas, TX 75251 13-September-2016

C# Developer
Source: CareWorks Tech
Details: ASP.Net, ASP.Net MVC. Proven track record of hands-on technical design and code work within large complex systems....  More
30+ days ago

Columbus, OH 15-August-2016

.Net Developer(Front end Technologies)
Source: Indeed
Details: Projects range widely from SharePoint applications (including Visual Web Parts), to Windows services, to full-stack ASP.NET MVC applications....  More
6 days ago

Redmond, WA 20-September-2016

Software Developer
Source: Indeed
Details: The Software Developer must have knowledge of Microsoft technologies, including Microsoft .NET 4.0/4.5, C#, ASP.NET MVC, WebApi, IIS, Entity Framework, SQL...  More
13 days ago

Chesapeake, VA 13-September-2016

Software Developer Intern
Source: Health Catalyst
Details: Job Title: SoftwareDeveloper/Test Intern Department: Product Development Classification: Intern Status: Full-time (40 hours/week) Location: Salt Lake City  More
14 days ago

Salt Lake City, UT 12-September-2016

Junior Software Developer
Source: Indeed
Details: Net MVC, C#, VB.Net, SQL Server, Visual Studio, and Web Services. Junior Software Developer*....  More
18 days ago

Irving, TX 08-September-2016

Software Developer
Source: NuGrowth Solutions
Details: The ideal candidate will be fluent in C#, ASP.NET MVC, SQL Server and Web Service Architecture. SIS, a leading provider of Agency Management Systems for...  More
16 days ago

Columbus, OH 43228 10-September-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.