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 Tutorials:

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 Related Articles:

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]

Top ASP.NET MVC Jobs

.Net Developer
Source: Indeed
Details: ASP.NET MVC, JQuery, Entity framework, HTML programming. .Net MVC 4.0 and Strong experience in designing and developing layered web based applications with...  More
24 days ago

Bellevue, WA 01-February-2017

.NET DEVELOPER
Source: Indeed
Details: ASP.NET MVC, JQuery, Entity framework, HTML programming. .Net MVC 4.0 and Strong experience in designing and developing layered web based applications with...  More
24 days ago

Seattle, WA 01-February-2017

.Net Developer
Source: Indeed
Details: C#.NET, VB.NET and/or ASP.NET MVC, TFS.Web development tools including HTML5, JavaScript, jQuery, AJAX, LINQ, CSS,....  More
21 days ago

Rockwell, MD 03-February-2017

.NET Developer, Junior
Source: Booz Allen Hamilton
Details: 1+ years of experience with ASP.NET, MVC, or Web forms development. Booz Allen Hamilton has been at the forefront of strategy and technology for more than 100...  More
15 hours ago

Atlanta, GA 25-February-2017

Senior Software Developer #17-043
Source: Indeed
Details: Experience building web applications using Google Web Toolkit (GWT) or frameworks such as ASP.NET MVC, Spring MVC, Angular, Ember, or React....  More
3 days ago

Arlington, VA 22-February-2017

.NET / Mobile Application Developer, Junior
Source: Booz Allen Hamilton
Details: 1+ years of experience with ASP.NET, MVC, or Web forms development. Booz Allen Hamilton has been at the forefront of strategy and technology for more than 100...  More
2 days ago

Atlanta, GA 22-February-2017

Application Developer -- C#, ASP.NET Web Forms/MVC
Source: Indeed
Details: .NET framework (3.5 or newer) -- especially with .NET Web Services, ASP.NET MVC, ASP.NET Web Forms and LINQ. We have a fulltime programmer position open for an...  More
2 days ago

Golden Valley, MN 23-February-2017

Software Developer (.NET Web Services & API)
Source: Indeed
Details: C#, ASP.NET, MVC or better required, Java/Node.js a plus. If you’re looking for a rewarding career with a dynamic and fast-growth healthcare software company,...  More
3 days ago

Tucson, AZ 22-February-2017

Junior Level .NET Developer
Source: Levi, Ray & Shoup, Inc.
Details: Time to get to work! LRS Consulting Services is seeking a Junior Level .NET Developer for a 3-6 month contract-to-hire opportunity with our client in Central  More
8 days ago

Illinois 17-February-2017

.NET Software Developer
Source: Indeed
Details: ASP.NET, Entity Framework, MVC, Ajax, jQuery, Bootstrap. Web application development using Visual Studio (2013, 2015) C# and ASP.NET MVC, JavaScript, Ajax, LINQ...  More
3 days ago

Fairfax, VA 22030 21-February-2017

Junior .NET Developer
Source: SBG Technology Solutions
Details: Must have a clear understanding of ASP.NET MVC, and MVC application design pattern experience. At least five (5) years of development experience, including 4+...  More
11 days ago

Alexandria, VA 22314 14-February-2017

.Net Developer
Source: Indeed
Details: MVC:. Develop web, web services and back-office applications using the newest Microsoft stack of technologies including Net CORE, ASP.NET, MVC, Angular,...  More
7 days ago

Charlotte, NC 17-February-2017

Senior Software Engineer
Source: Indeed
Details: Web based user interface software development using Angular2, JavaScript, Bootstrap, Web API, ASP.NET MVC, etc....  More
15 days ago

Tucson, AZ 09-February-2017

Certified Microsoft .NET Developer
Source: Indeed
Details: The project includes .Net MVC web applications with heavy use of JavaScript, jQuery and Kendo UI components....  More
9 days ago

Madison, WI 15-February-2017

Front End Developer
Source: Indeed
Details: Experience with ASP.NET MVC, Web APIs, C#, and the .NET Framework. Rational is a full service, integrated agency with proven ability to deliver across digital,...  More
1 day ago

Redmond, WA 23-February-2017

Junior .NET Developer
Source: Publishers Clearing House
Details: Windows Forms, WCF, ASP.NET, MVC. Publishers Clearing House (PCH), headquartered in Port Washington, NY (soon to be Jericho, NY!)....  More
30+ days ago

Port Washington, NY 11050 12-December-2016

Developer - Full Stack ASP.NET MVC, C#, SQL Server
Source: Indeed
Details: ASP.NET MVC, C#, SQL Full Stack Server Developer (Austin, Tx)*. Who We Are ...*....  More
7 days ago

Austin, TX 78759 17-February-2017

NET DEVELOPER - SENIOR (FULL-TIME CONTRACTUAL)
Source: State of Maryland
Details: ASP.NET MVC with Razor. SQL Server 2012, Visual Studio 2015, .NET 4.6 and MVC 5. Development, maintenance, trouble-shooting and debugging of .NET applications...  More
7 days ago

Baltimore, MD 17-February-2017

NET DEVELOPER - JUNIOR (FULL-TIME CONTRACTUAL)
Source: State of Maryland
Details: ASP.NET MVC with Razor. SQL Server 2012, Visual Studio 2015, .NET 4.6 and MVC 5. Development, maintenance, trouble-shooting and debugging of .NET applications...  More
7 days ago

Baltimore, MD 17-February-2017

.Net Developer
Source: Indeed
Details: ASP.NET MVC and WebForms. Net Developer- Las Vegas, NV. Must be authorized to work in the USA.*....  More
30+ days ago

Las Vegas, NV 06-December-2016

Full Stack Developer IV
Source: Indeed
Details: Minimum 4 years experience with writing WebAPI/RESTFul API and working in an ASP.NET MVC environment. Keyventer is seeking a *Full Stack Web*....  More
2 days ago

Seattle, WA 22-February-2017

Full Stack Web Developer
Source: Indeed
Details: C# / ASP.NET MVC. Opportunity to play with a modern Microsoft-oriented web stack (C# 7, Typescript, ASP.NET MVC, EF/LINQ, React/Redux, HTML5, Sass, VS2017,...  More
3 days ago

Seattle, WA 22-February-2017

.Net Developer
Source: Indeed
Details: *Job Functions and Responsibilities: * Looking for a multi-talented software/web developer to add to ITCON Services dynamic team supporting a highly visible  More
30+ days ago

Washington, DC 02-November-2016

AWS Developer
Source: Indeed
Details: Amazon experience is amust *Ruby-on-rails* and *Java* for a Amazon’s new project,. Requirement is simply three: * JavaScript: 3-5 years * Ruby on rails -...  More
8 days ago

Redmond, WA 16-February-2017

Web Developer - 3888
Source: Indeed
Details: 3-5+ years development with Microsoft ASP.NET MVC (including jQuery, Knockout/Angular). ISoftStone North America is looking for a Web Developer to join our...  More
10 days ago

Redmond, WA 14-February-2017
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.