A Practical Guide to ASP.NET Web API

By | February 17, 2014
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisShare on StumbleUponPin 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
  • 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]


Sr .NET Developer
Source: Indeed
Details: Proven experience with Microsoft .NET technologies including, ASP.NET MVC 4/5, Entity Framework 6. Sr....  More
7 days ago

Alpharetta, GA 18-October-2016

Full Stack .Net Developer ***LOCAL OR FULL TIME NEED TO APPLY!)
Source: Indeed
Details: Visual Studio 2015, SQL Server 2008+ architectural, .NET 4/4.5 FCL, C# language and syntax, SQL, ASP.NET/ASP.NET MVC, HTML 5, and CSS 3....  More
11 days ago

Bellevue, WA 98004 14-October-2016

Sr. Net Developer
Source: ECOM
Details: JOB SUMMARY: The senior software developer designs and develops applications and systems intended for processing of stored-value payment cards in physical,  More
14 days ago

Overland Park, KS 11-October-2016

Full Stack Web Developer
Source: Centerplate
Details: Extensive knowledge of SQL and experience with MySQL, DB2, or MS-SQL Knowledge of MVC architecture and experience with MVC Frameworks (Zend, Symphony, ASP.NET...  More
8 days ago

Greenville, SC 17-October-2016

Software Engineer
Source: Indeed
Details: Expertise in most of the following –Web API ( *MS ASP.Net), MVC, WCF, HTML5, CSS*. , JavaScript, JSON, SOAP, REST, JQuery, .Net Framework, C#, Web Services....  More
4 days ago

Austin, TX 21-October-2016

Sr .NET Developer
Source: Caliber Business Systems
Details: 2+ years developing ASP.net MVC, BootStrap, Jquery. Utilize established development tools, guidelines and conventions including but not limited to Visual Studio...  More
30+ days ago

Fort Lauderdale, FL 24-September-2016

Full Stack Developer
Source: Ledgent Technology & Engineering
Details: Nice to have Classic ASP. Provide expertise in using ASP.net, MVC framework, C#, Javascript and SQL. Want an experienced web developer with .net, classic asp,...  More
26 days ago

Huntington Beach, CA 29-September-2016

Full Stack .Net Developer
Source: Indeed
Details: —Web API (MS ASP.Net), MVC, WCF, HTML5, CSS, JavaScript, JSON, SOAP, REST, JQuery, .Net Framework, C#, Web Services....  More
27 days ago

Round Rock, TX 28-September-2016

.NET Developer - Face to Face Interview in FL & PA
Source: Indeed
Details: .Net Developer Long Term Contract Face to Face Interview MUST HAVE:  6+ years’ experience in Software Development with .Net including: o C# o ASP.NET o...  More
8 days ago

Harrisburg, PA 17-October-2016

.Net Developer
Source: Indeed
Details: NET Developer - Harrisburg, PA.*. 3+ years of Net web application development. Experience with ASP.NET MVC, Angular.js, and or Bootstrap preferred....  More
11 hours ago

Harrisburg, PA 25-October-2016

.Net developer At Rancho Cordova,CA (Only W2 )
Source: Indeed
Details: ASP.NET MVC experience is required. Build and maintain application functionality for new and existing systems....  More
13 days ago

Rancho Cordova, CA 12-October-2016

.Net Developer with Angular JS
Source: Indeed
Details: 2+ years of experience with JavaScript and client MVC frameworks like AngularJS.\*. Need W2 Consultants C2H Postion....  More
13 days ago

Houston, TX 12-October-2016

Full-stack .NET developer
Source: Indeed
Details: MVC:. Solid ASP.NET MVC experience. This dynamic role will focus on building custom integration platforms within C#, MVC and Javascript....  More
30+ days ago

Houston, TX 19-September-2016

Full Stack .NET/C# Developer | must have JavaScript experience
Source: CareWorks Tech
Details: Primary Responsibilities: · Work in a collaborative, Agile, team environment. · Participate in design sessions with other Developers, Business Analysts,  More
30+ days ago

Columbus, OH 19-September-2016

.NET Web Developer
Source: Indeed
Details: Proficiency with ASP.NET MVC. Endesin is looking for an experienced .NET web developer that can handle all aspects related to the development and maintenance of...  More
14 days ago

East Aurora, NY 11-October-2016

Web Programmer
Source: Indeed
Details: C#/LINQ, Net MVC, MS SQL Server. Implement well designed database structures in MS SQL Server and integrate data from various back-end services to create...  More
8 days ago

Industry, CA 91746 18-October-2016

C#/.Net/MVC Developer (Oak Hill)Basic text editing
Source: RevolutionInsure
Details: If you are a seasoned full stack .NET MVC developer interested in a startup. Experience developing within a Windows environment using Microsoft's Visual Studio...  More
2 days ago

Austin, TX 23-October-2016

Front-End Software Developer
Source: Recity
Details: Familiarity with C# and ASP.NET MVC. Recity is a D.C-based Real Estate Analytics SaaS company that wants to change how real estate professionals understand and...  More
7 days ago

Washington, DC 19-October-2016

Sr .net Developer
Source: MJDP resources
Details: NET Developer with 7+ years of experience developing. O Visual Studio 2010 or later C#, ASP.NET WebForms, MVC, and .NET Framework 4.x....  More
1 day ago

King of Prussia, PA 24-October-2016

.Net Developer (Only W2)
Source: Indeed
Details: ASP.NET MVC experience. Web development including Classic ASP, ASP.NET. Website/web service and middleware development and support....  More
20 days ago

Maplewood, MN 05-October-2016

.Net Software Developer
Source: Indeed
Details: Web API, WCF, ASP.NET MVC, JavaScript, jQuery, Bootstrap, AngularJS, and Massive.*. SharpEcho is looking for talented *Consultants and Senior Consultants*....  More
7 days ago

Dallas, TX 75201 18-October-2016

Senior C#/ASP.NET Software Developer, Web Team
Source: Comcast
Details: ASP.NET, MVC, Entity Framework, AJAX, JQuery, Twitter Bootstrap. Visible World is the leading provider of targeted TV advertising solutions....  More
1 day ago

New York, NY 10001 25-October-2016

Programmer Analyst
Source: Halcyon Solutions
Details: .Net, ASP.Net, MVC, C#.Net, SQL Server; Uses ASP.Net MVC along with AngularJS and Web API to develop highly responsive websites which support web, tablet and...  More
13 days ago

Dublin, OH 43016 13-October-2016

Software Developer
Source: Indeed
Details: MVC experience preferred. Looking for a Software developer in Delphi and .NET with the following criteria*....  More
8 days ago

Oklahoma City, OK 17-October-2016

C# Developer
Source: Posh Technologies
Details: 5+ years of working experience with C#, ASP.Net MVC, SQL Server, JavaScript. 10+ years of Software development experience with strong background in computer...  More
30+ days ago

Redmond, WA 20-September-2016
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisShare on StumbleUponPin on Pinterest
Category: ASP.NET ASP.NET Web API Tags:


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.