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.

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]

Top ASP.NET MVC Jobs

Programmer
Source: Indeed
Details: MVC:. ASP.NET MVC, ASP.NET AJAX,C#, C++, SSIS, Object Oriented Programming, T-SQL, JAVA, Telerik Controls, Javascript....  More
3 days ago

Guaynabo, PR 17-August-2017

Programmer
Source: Indeed
Details: Experience in developing web applications using ASP.NET, MVC, Javascript, JQuery. CorTrust Bank is looking for a talented programmer to create secure and...  More
9 days ago

Mitchell, SD 11-August-2017

ASP.NET MVC Web Developer
Source: Cardinal Intellectual Property
Details: ASP.NET MVC Web Developer. Strong or expert knowledge of C#, JQuery, JavaScript, Knockout JS, ASP.NET MVC, MSSQL....  More
2 days ago

Dallas, TX 19-August-2017

Senior Software Engineer, .net, MVC
Source: Indeed
Details: Experience in MVC, preferably ASP.NET MVC 4. Alteso is looking to add a developer to our technology team building cutting edge software for the Auto Re...  More
4 days ago

Trevose, PA 19053 17-August-2017

Full Stack.net Web Application Developer
Source: Indeed
Details: 4+ years of experience building ASP.NET MVC web applications using C# and JavaScript. Thrift Books is looking for a Full Stack Application Developer to help...  More
25 days ago

Seattle, WA 26-July-2017

ASP.NET MVC Web Developer
Source: Cardinal Intellectual Property
Details: ASP.NET MVC Web Developer. Strong or expert knowledge of C#, JQuery, JavaScript, Knockout JS, ASP.NET MVC, MSSQL....  More
5 days ago

Houston, TX 16-August-2017

Full Stack .NET Web Developer
Source: Ursus Incorporated
Details: 3+ Years working with C#, ASP.NET MVC, HTML, CSS, JavaScript. Full Stack .NET Web Developer....  More
9 days ago

Davis, CA 95618 11-August-2017

.NET Web Developer
Source: MIS Choice
Details: Moderate knowledge of ASP.NET MVC, HTML5, JavaScript. .NET Web Developer for Aviation Industry Software Leader....  More
10 days ago

Mount Prospect, IL 60056 11-August-2017

ASP.NET MVC Web Developer
Source: Cardinal Intellectual Property
Details: ASP.NET MVC Web Developer. Strong or expert knowledge of C#, JQuery, JavaScript, Knockout JS, ASP.NET MVC, MSSQL....  More
5 days ago

Evanston, IL 16-August-2017

Web Developer Full Stack C# .Net, MVC, SQL, JavaScript, jQuery, Kendo
Source: Indeed
Details: 5+ years ASP.NET MVC 3/4/5. Translate storyboards and use cases into applications/services....  More
16 days ago

Westlake Village, CA 91362 04-August-2017

C# ASP.Net Web Developer
Source: Indeed
Details: Experience with various web technologies, such as HTML, CSS, AJAX, JQuery, JavaScript, AngularJS, Bootstrap, XML, ASP.NET, MVC, WebForms, Web Services, IIS....  More
18 days ago

Irvine, CA 02-August-2017

ASP.NET MVC Web Developer
Source: Professional Technology Integration, Inc.
Details: ASP.NET MVC - 5 Years. ASP.NET MVC (Required 3 Years). C#, ASP.NET MVC, ADO.NET, AJAX, jQuery, JavaScript, XML, CSS and Visual Studio 2013/2015....  More
20 days ago

Harrisburg, PA 31-July-2017

c# asp.net web mvc/webapi software developer
Source: Indeed
Details: C#, ASP.NET MVC, ASP.NET Razor. Firestorm Technologies is looking for an experienced C# asp.net MVC / WebAPI developer....  More
23 days ago

Oak Park, MI 48237 28-July-2017

Programmer
Source: Indeed
Details: ASP.NET MVC, JavaScript, HTML5, CSS3, and Bootstrap. Purpose of Position*....  More
30+ days ago

Plano, TX 75024 27-June-2017

.Net Engineer
Source: Employee Navigator
Details: Our engineers are responsible for building new products that provide a simple user experience for complicated business processes. This includes insurance  More
2 days ago

Gaithersburg, MD 19-August-2017

Web Developer - .NET
Source: Meridian Technology Group
Details: Required technical skills include C#, ASP.NET MVC, HTML, XML, Java Script, Visual Studio, PL/SQL, GIT, SOAP Web Services, Unit Testing with NUnit or MSTest,...  More
30+ days ago

Tualatin, OR 06-July-2017

.Net Web Developer
Source: COMPAS
Details: ASP.NET MVC, C#. Our Web Developers are at the core of what makes us unique....  More
30+ days ago

San Francisco, CA 13-July-2017

.NET Developer- Data Structure
Source: Indeed
Details: Middle tier (ASP.NET MVC / Java). Familiar with MVC, Entity Framework, ASP.NET,. Very strong knowledge in data structures and proven record in using the best...  More
3 days ago

Redmond, WA 17-August-2017

Full Stack .NET Software Engineer
Source: Indeed
Details: Firm understanding of MVC web applications – we use ASP.NET MVC, AngularJS and Bootstrap. National Decision Support Company (NDSC) is currently seeking talented...  More
11 days ago

Madison, WI 09-August-2017

Junior .Net Developer Job
Source: SAIC
Details: A successful candidate will provide ASP.NET MVC, VB.NET, LINQ, AngularJS, Bootstrap, JQuery, CSS, IIS, and SQL Server programming support and work with an...  More
2 days ago

Houston, TX 18-August-2017

.NET Developer
Source: Charles Schwab
Details: 2+ years of ASP.NET MVC experience. Lone Tree - CO, DENR3, 9800 Schwab Way, 80124....  More
2 days ago

Lone Tree, CO 80124 19-August-2017

.Net Developer - Seattle Locals only
Source: Indeed
Details: Middle tier (ASP.NET MVC / Java). Familiar with MVC, Entity Framework, ASP.NET. Very strong knowledge in data structures and proven record in using the best...  More
6 days ago

Redmond, WA 14-August-2017

Full-Stack .NET Developer
Source: Intellisoft Technologies
Details: ASP.NET MVC and WebAPI. Need candidates who can work on our W2....  More
10 days ago

Dallas, TX 11-August-2017

Jr .Net Developer
Source: Indeed
Details: Asp.net MVC Framework 6.0, AJAX, Angular 2, Bootstrap, CSS, 3rd party controls(Mandatory). Good communication and coordination skills working in onshore and...  More
6 days ago

Seattle, WA 14-August-2017

Junior Software Developer
Source: Metro IT Resources
Details: ASP.NET MVC, ASP.NET AJAX,C#, C++, SSIS, Object Oriented Programming, T-SQL, JAVA, Telerik Controls, Javascript....  More
10 days ago

Puerto Rico 11-August-2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest