SlideShare a Scribd company logo
#td17ch
Building HTTP APIs with
ASP.NET Core
Filip Wojcieszyn
Tech Lead CloudServices, Sonova
@filip_woj
strathweb.com
sonova.com
Before ASP.NET Core
 HTTP Handlers
 ASMX
 WCF Web Http | WCF REST Starter Kit
 ASP.NET MVC
 WCF Web API | ASP.NET Web API
Building HTTP APIs with ASP.NET Core
Agenda
Plan for today
 Lightweight HTTP APIs
 Security
 Documentation
 Versioning
 Demos
https://github.com/filipw/aspnetcore-api-samples
Lightweight HTTP APIs
What would Martin Fowler do?
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Source: https://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/
Lightweight APIs with ASP.NET Core
Prefer the IRouter extensions
Super lightweight - modeled after other platforms - e.g. Node, Go, Swift
Use MVC for more complex backends
Don’t unnecessarily rely on the full framework
When using MVC, pick and choose pieces you
need
AddMvcCore() method allows you to add only most basic framework services
Super
lightweight
Whole API in single C# file
No MVC
Minimal footprint
How To Not Set Up an MVC-based API
How To Set Up an MVC API
Security
HTTP API Security
Use JSON Web Tokens (JWT)
IdentityServer4 is the most popular OpenID Connect and OAuth 2.0 framework for
ASP.NET/ASP.NET Core
Tokens can be issued from an embedded server
too
API could act both as identity and resource server at the same time
ASP.NET Core introduces “Authorization Policies”
Centralized way to define required claim validations
Building HTTP APIs with ASP.NET Core
Securing an API (embedded server)
Documentation
HTTP API Documentation
Swagger has become a de facto standard
Defines swagger.json descriptor file, that allows easy client generation
Swashbuckle package for ASP.NET Core
Can generate swagger.json for your MVC-based HTTP API
ASP.NET Core MVC exposes IApiExplorer service
In case you need to manually traverse the endpoints
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Versioning
Versioning is difficult
HTTP API Versioning Approaches
URI-based
GET /v1/contacts
GET /contacts?v=1
Header-based
GET /contacts
Version: 2
Media type-based
GET /contacts
Accept: application/vnd.contact-v2+json
HTTP API Versioning packages
Microsoft.AspNetCore.Mvc.Versioning
A Microsoft versioning package for ASP.NET Core MVC
WebApiContrib.Core.Versioning
A community versioning package for ASP.NET Core MVC
© 2017 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and
Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
© 2017 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and
Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Ad

Recommended

ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
The Universal Programming Language: C#
The Universal Programming Language: C#
BizTalk360
 
ASP.NET Core MVC + Web API with Overview (Post RC2)
ASP.NET Core MVC + Web API with Overview (Post RC2)
Shahed Chowdhuri
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
Moving ASP.NET MVC to ASP.NET Core
Moving ASP.NET MVC to ASP.NET Core
John Patrick Oliveros
 
Moving forward with ASP.NET Core
Moving forward with ASP.NET Core
Enea Gabriel
 
ASP.NET Core Unit Testing
ASP.NET Core Unit Testing
Shahed Chowdhuri
 
ASP.NET Core 1.0 Overview
ASP.NET Core 1.0 Overview
Shahed Chowdhuri
 
Getting Started with ASP.net Core 1.0
Getting Started with ASP.net Core 1.0
joescars
 
ASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex Systems
Shahed Chowdhuri
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
ASP.NET Brief History
ASP.NET Brief History
Sudhakar Sharma
 
Evolution / History of ASP.NET
Evolution / History of ASP.NET
Anoop Kumar Sharma
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Rodolfo Finochietti
 
What's New in ASP.NET Core 3
What's New in ASP.NET Core 3
Andrea Dottor
 
Microsoft <3 Linux with ASP.NET Core
Microsoft <3 Linux with ASP.NET Core
John Patrick Oliveros
 
Introduction to ASPNET Core
Introduction to ASPNET Core
Puja Pramudya
 
.Net Core 1.0 vs .NET Framework
.Net Core 1.0 vs .NET Framework
Wyn B. Van Devanter
 
Dependency Injection in Silverlight
Dependency Injection in Silverlight
Caleb Jenkins
 
ASP.NET 5 Overview
ASP.NET 5 Overview
Shahed Chowdhuri
 
ASP.NET Core
ASP.NET Core
Maurice De Beijer [MVP]
 
ASP.NET Core
ASP.NET Core
Andrea Dottor
 
Introduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015
Shahed Chowdhuri
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
Shiju Varghese
 
Deploy a Website in Azure using ARM Templates
Deploy a Website in Azure using ARM Templates
Pratik Khasnabis
 
Fullstack workshop
Fullstack workshop
Assaf Gannon
 
Embrace HTTP with ASP.NET Web API
Embrace HTTP with ASP.NET Web API
Filip W
 
ASP.NET Web API Deep Dive - SSD 2016 London
ASP.NET Web API Deep Dive - SSD 2016 London
Manfred Steyer
 

More Related Content

What's hot (20)

ASP.NET Core 1.0 Overview
ASP.NET Core 1.0 Overview
Shahed Chowdhuri
 
Getting Started with ASP.net Core 1.0
Getting Started with ASP.net Core 1.0
joescars
 
ASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex Systems
Shahed Chowdhuri
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
ASP.NET Brief History
ASP.NET Brief History
Sudhakar Sharma
 
Evolution / History of ASP.NET
Evolution / History of ASP.NET
Anoop Kumar Sharma
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Rodolfo Finochietti
 
What's New in ASP.NET Core 3
What's New in ASP.NET Core 3
Andrea Dottor
 
Microsoft <3 Linux with ASP.NET Core
Microsoft <3 Linux with ASP.NET Core
John Patrick Oliveros
 
Introduction to ASPNET Core
Introduction to ASPNET Core
Puja Pramudya
 
.Net Core 1.0 vs .NET Framework
.Net Core 1.0 vs .NET Framework
Wyn B. Van Devanter
 
Dependency Injection in Silverlight
Dependency Injection in Silverlight
Caleb Jenkins
 
ASP.NET 5 Overview
ASP.NET 5 Overview
Shahed Chowdhuri
 
ASP.NET Core
ASP.NET Core
Maurice De Beijer [MVP]
 
ASP.NET Core
ASP.NET Core
Andrea Dottor
 
Introduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015
Shahed Chowdhuri
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
Shiju Varghese
 
Deploy a Website in Azure using ARM Templates
Deploy a Website in Azure using ARM Templates
Pratik Khasnabis
 
Fullstack workshop
Fullstack workshop
Assaf Gannon
 
Getting Started with ASP.net Core 1.0
Getting Started with ASP.net Core 1.0
joescars
 
ASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex Systems
Shahed Chowdhuri
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
Evolution / History of ASP.NET
Evolution / History of ASP.NET
Anoop Kumar Sharma
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Rodolfo Finochietti
 
What's New in ASP.NET Core 3
What's New in ASP.NET Core 3
Andrea Dottor
 
Microsoft <3 Linux with ASP.NET Core
Microsoft <3 Linux with ASP.NET Core
John Patrick Oliveros
 
Introduction to ASPNET Core
Introduction to ASPNET Core
Puja Pramudya
 
Dependency Injection in Silverlight
Dependency Injection in Silverlight
Caleb Jenkins
 
Introduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015
Shahed Chowdhuri
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
Shiju Varghese
 
Deploy a Website in Azure using ARM Templates
Deploy a Website in Azure using ARM Templates
Pratik Khasnabis
 
Fullstack workshop
Fullstack workshop
Assaf Gannon
 

Viewers also liked (19)

Embrace HTTP with ASP.NET Web API
Embrace HTTP with ASP.NET Web API
Filip W
 
ASP.NET Web API Deep Dive - SSD 2016 London
ASP.NET Web API Deep Dive - SSD 2016 London
Manfred Steyer
 
Azure api app autenticação e autorização
Azure api app autenticação e autorização
Nicolas Takashi
 
Azure api apps - Deploy ASP.Net Core
Azure api apps - Deploy ASP.Net Core
Nicolas Takashi
 
Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!
Sandro Pereira
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
Levi Fuller
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET MVC by Software development company in india
iFour Institute - Sustainable Learning
 
Aspnet core
Aspnet core
eleksdev
 
ASP.NET Core Security
ASP.NET Core Security
Albert Weinert
 
Building a Web API with ASP.Net Core
Building a Web API with ASP.Net Core
BizTalk360
 
Swagger - make your API accessible
Swagger - make your API accessible
Victor Trakhtenberg
 
Web api
Web api
Sudhakar Sharma
 
Toi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dung
IT Expert Club
 
The Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API Security
Stormpath
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with Ion
Stormpath
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.js
Stormpath
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
Stormpath
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
RESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web API
💻 Spencer Schneidenbach
 
Embrace HTTP with ASP.NET Web API
Embrace HTTP with ASP.NET Web API
Filip W
 
ASP.NET Web API Deep Dive - SSD 2016 London
ASP.NET Web API Deep Dive - SSD 2016 London
Manfred Steyer
 
Azure api app autenticação e autorização
Azure api app autenticação e autorização
Nicolas Takashi
 
Azure api apps - Deploy ASP.Net Core
Azure api apps - Deploy ASP.Net Core
Nicolas Takashi
 
Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!
Sandro Pereira
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
Levi Fuller
 
Aspnet core
Aspnet core
eleksdev
 
Building a Web API with ASP.Net Core
Building a Web API with ASP.Net Core
BizTalk360
 
Swagger - make your API accessible
Swagger - make your API accessible
Victor Trakhtenberg
 
Toi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dung
IT Expert Club
 
The Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API Security
Stormpath
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with Ion
Stormpath
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.js
Stormpath
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
Stormpath
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
RESTful API Design Best Practices Using ASP.NET Web API
RESTful API Design Best Practices Using ASP.NET Web API
💻 Spencer Schneidenbach
 
Ad

Similar to Building HTTP APIs with ASP.NET Core (20)

ASP.net web api Power Point Presentation
ASP.net web api Power Point Presentation
BefastMeetingMinutes
 
ASP.NET Core 1.0
ASP.NET Core 1.0
Ido Flatow
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development
GlobalLogic Ukraine
 
CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API
CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API
Codecamp Romania
 
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Agusto Sipahutar
 
ASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-Devs
Manfred Steyer
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
NETFest
 
Building Web Apis With Aspnet Core Meap Version 11 All 12 Chapters Valerio De...
Building Web Apis With Aspnet Core Meap Version 11 All 12 Chapters Valerio De...
anjumlehde00
 
Explore asp.net core 3.0 features
Explore asp.net core 3.0 features
iFour Technolab Pvt. Ltd.
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6
Amin Mesbahi
 
Introduction-to-ASPNET-Core ASP.NET.pptx
Introduction-to-ASPNET-Core ASP.NET.pptx
MAHERMOHAMED27
 
ASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By Scholarhat
Scholarhat
 
.NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18
Amin Mesbahi
 
All the amazing features of asp.net core
All the amazing features of asp.net core
GrayCell Technologies
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
ASP.net web api Power Point Presentation
ASP.net web api Power Point Presentation
BefastMeetingMinutes
 
ASP.NET Core 1.0
ASP.NET Core 1.0
Ido Flatow
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development
GlobalLogic Ukraine
 
CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API
CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API
Codecamp Romania
 
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Agusto Sipahutar
 
ASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-Devs
Manfred Steyer
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
NETFest
 
Building Web Apis With Aspnet Core Meap Version 11 All 12 Chapters Valerio De...
Building Web Apis With Aspnet Core Meap Version 11 All 12 Chapters Valerio De...
anjumlehde00
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6
Amin Mesbahi
 
Introduction-to-ASPNET-Core ASP.NET.pptx
Introduction-to-ASPNET-Core ASP.NET.pptx
MAHERMOHAMED27
 
ASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By Scholarhat
Scholarhat
 
.NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18
Amin Mesbahi
 
All the amazing features of asp.net core
All the amazing features of asp.net core
GrayCell Technologies
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
Shahed Chowdhuri
 
Ad

Recently uploaded (20)

Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
WSO2
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 

Building HTTP APIs with ASP.NET Core

  • 1. #td17ch Building HTTP APIs with ASP.NET Core Filip Wojcieszyn Tech Lead CloudServices, Sonova
  • 3. Before ASP.NET Core  HTTP Handlers  ASMX  WCF Web Http | WCF REST Starter Kit  ASP.NET MVC  WCF Web API | ASP.NET Web API
  • 5. Agenda Plan for today  Lightweight HTTP APIs  Security  Documentation  Versioning  Demos https://github.com/filipw/aspnetcore-api-samples
  • 7. What would Martin Fowler do?
  • 11. Lightweight APIs with ASP.NET Core Prefer the IRouter extensions Super lightweight - modeled after other platforms - e.g. Node, Go, Swift Use MVC for more complex backends Don’t unnecessarily rely on the full framework When using MVC, pick and choose pieces you need AddMvcCore() method allows you to add only most basic framework services
  • 12. Super lightweight Whole API in single C# file No MVC Minimal footprint
  • 13. How To Not Set Up an MVC-based API
  • 14. How To Set Up an MVC API
  • 16. HTTP API Security Use JSON Web Tokens (JWT) IdentityServer4 is the most popular OpenID Connect and OAuth 2.0 framework for ASP.NET/ASP.NET Core Tokens can be issued from an embedded server too API could act both as identity and resource server at the same time ASP.NET Core introduces “Authorization Policies” Centralized way to define required claim validations
  • 18. Securing an API (embedded server)
  • 20. HTTP API Documentation Swagger has become a de facto standard Defines swagger.json descriptor file, that allows easy client generation Swashbuckle package for ASP.NET Core Can generate swagger.json for your MVC-based HTTP API ASP.NET Core MVC exposes IApiExplorer service In case you need to manually traverse the endpoints
  • 26. HTTP API Versioning Approaches URI-based GET /v1/contacts GET /contacts?v=1 Header-based GET /contacts Version: 2 Media type-based GET /contacts Accept: application/vnd.contact-v2+json
  • 27. HTTP API Versioning packages Microsoft.AspNetCore.Mvc.Versioning A Microsoft versioning package for ASP.NET Core MVC WebApiContrib.Core.Versioning A community versioning package for ASP.NET Core MVC
  • 28. © 2017 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • 29. © 2017 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.