Call Us: +32 2 466 00 16
Follow Us:

Building REST Services with ASP.NET Web API

Training code
Book this course

The HTTP Protocol

A surprising amount of developers don't know how HTTP works. Since this is the foundation for REST, we'll do a quick recap.

  • Http Verbs
  • Headers
  • Status Codes
  • Redirection
  • Caching


Roy Fielding, the inventor of REST, realized that using the HTTP protocol you can also use HTTP to work with data stored in a database. Here we will look at how REST uses HTTP to serve data instead of web pages.

  • The State of the Web
  • How REST works
  • REST versus SOAP

Introducing Web API

Whether you create Web services in .NET Framework or .NET Core, Web Api is one of the best ways to start with this. The MVC approach works very well for REST and that's why Web API is an adapted version of ASP.NET MVC specifically designed for REST. This module serves as an overview of the framework.

  • Architecture
  • CRUD operations
  • Feature Overview

Consuming an ASP.NET Web API REST service

Web API builds the server. But you also need a client. This can be any application as long as it supports HTTP. This can be a web site, a desktop app, a mobile app,... In this module we'll take a look at what .NET and javascript provides for client-side consumption.

  • Consuming with a .NET Client: HttpClient
  • Serialization and Deserialization in .NET
  • Consuming data using jQuery AJAX and the fetch api

ASP.NET Web API Routing

A URL and an HTTP verb create a request. Whether you create these services in .NET Core or Framework doesn't matter. Having full control over what happens in our Web Service is essential for any Web API developer.

  • Convention-based routing
  • Routing Attributes
  • Routing Errors

ASP.NET Web API Controllers

In this module we'll take a closer look at the C in MVC. The controller has a very important role to fulfill: It's the component that figures out what to do when receiving a request.

  • The ApiController and .NET Core ControllerBase Class
  • Action Methods
  • Understanding I(Http)ActionResult
  • Using the new ProblemDetails class for error reporting
  • Filters
  • Using Open API to expose meta-data about your Web API

Content Negotiation with ASP.NET Web API

I want JSON, but this other person wants XML and a third person wants CSV. This module will teach you how to handle such a case with minimal overhead in .NET Framework and .NET Core.

  • Media types
  • Built-in Content Negotiation
  • Custom Formatters

OData Overview

Just like SQL is a query language for databases, ODATA is a query language for REST. This allows the client to specify exactly what it wants to receive. At the same time the server is still in control of what is allowed and what not. This module is about the ODATA standard itself.

  • What is ODATA
  • ODATA formats
  • Developing with ODATA
  • Client and Server
  • Querying ODATA services

Building OData REST Services with ASP.NET Web API

The previous module handles ODATA in a theoretical way. This module will show you how to implement ODATA with Web API.

  • Building an ODATA service using Web API (.NET Core and .NET Framework)
  • Creating the Controller
  • Configure Web API
  • Adding Features

Consuming OData REST in .NET

Server? Check! Now let's build a client.

  • ODATA Service Proxy
  • MetaData
  • Querying ODATA services
  • Modifying data
  • Actions

Model Validation

  • Model binding
  • The Modelstate
  • Validation Attributes
  • Returning validation errors
  • Customizing validation output with the InvalidModelStateResponseFactory class

Securing your Web API service

Security is a world on its own. In this module we'll explore the common techniques to secure your Web API.

  • Authentication & Authorization
  • Authorization Attributes
  • Authentication in HTTP
  • Authentication Options
  • Cross-Site Request Forgery

Getting your data from one side to the other. It's a persistent problem for developers. By using HTTP as the application protocol; REST is a reliable, performant and easy approach for building Web Services. ASP.NET Web API is Microsoft's answer to the growing demand, and is built up from the ground to alleviate REST development in both .NET Framework and Core.

Participants of this course need to have a solid understanding of the .NET platform and have built .NET applications using either C# or VB.NET. Knowledge about ASP.NET MVC (.NET Framework or .NET Core) or ASP.NET in general is a plus.

© 2020 U2U All rights reserved.