Web API 100

Overview

This course is meant for C# Developers tasked with creating HTTP-Based APIs in support of the business and technical requirements of your company.

It provides some "big picture" coverage of buzzwords like "Service Oriented Architecture", "Microservices", "CI/CD", and Developer Testing.

Primarily, this course is designed to take a C# developer with little or no experience building HTTP-based APIs with .NET (".NET Core"), to the point where they can successfully implement HTTP endpoints to process requests and produce HTTP Responses.

Format

This four-day course will prepare developers to HTTP-based APIs using Microsoft's .NET Platform (Currently .NET 9).

The class will include periods of lecture, "Code With Me", and short practice exercises. In addition, two multi-hour labs will be included to help developers integrate the concepts from the class.

Dedicated time will be allocated daily for questions and one-on-one code reviews.

Prerequisites

This is developer training. We assume developers are proficient with C# and Visual Studio.

Objectives

The objective of this course is for experienced developers to "upsize" their skills to successfully recognize and implement software coding and development patterns for a successful API project.

Introduction to HTTP As an Application Layer Protocol

  • Service Relationships Explained
  • The HTTP "Constraints" And How They Guide Our Design
  • The Three Parts of API Design: Resources, Representation, HTTP Methods
  • Designing Evolvable APIs

Implementing HTTP Resources in ASP.NET

  • The ASP.NET MVC Runtime and Configuration
  • Using Controller to Provide HTTP Resources
  • Using "Minimal APIs" to Provide HTTP Resources
  • Comparing Controllers and Minimal APIs
  • Providing Services to your API Endpoints - Dependency Injection and Service Lifetime
  • The Importance and Proper Use of async/await for Backing Services
  • Accessing Request State: Header, Cookies, Route Parameter, Query Strings
  • Processing and Validating Request Entities
  • Documenting Your API with The OpenAPI Specification (a.k.a. "Swagger")
  • Caching: Object Caching and HTTP Response Caching with Cache-Control Headers
  • Performing RPC Communication with Backing Services (Other APIs) using the HTTP Client
  • Providing Resiliency For API Calls

Implement Authentication and Authorization For Your API

  • Understanding the Foundations of Open ID Connect (OIDC) and OAuth2
  • Differentiating Authentication and Authorization
  • Creating Authorization Policies
  • Testing Your Authentication and Authorization
  • Using the HTTP "Store" Archetype To Mirror Client State at the Server

Introduction to the Developer Testing of APIs

  • Writing Low-Level Unit Tests For Your API
  • Writing Low-Level Unit Integration Tests for Your API
  • Writing System Tests for Your API
  • Stubbing and Mocking Dependencies
  • Isolating Your Unit Integration and System Tests From Backing Services
    • Development Databases
    • Mocking HTTP Requests and Responses

Expected Outcome of this Training

At the conclusion of the DevOps for Developers course, developers will be able to:

  • Know low-level coding practices that contribute to DevOps success.
  • Master .NET Configuration
  • Master Service Registration and Dependency Injection
  • Understand the Role of Developer Testing in Creating Reliable, Independently Deployable APIs
  • Understand API Versioning schemes and how to implement them.
  • Implement Authentication and Authorization using OIDC and OAuth2, and how to test these.
  • Preparing Your API To Execute in Varying Environments (Dev, Test, Staging, Production, Etc.)
  • Structuring a Project For Maximum Understandability and Working in a Team ("Vertical Slice Architecture")
  • Have a Strong Understanding of the Power and Limitations of HTTP