SlideShare a Scribd company logo
ASP.NET Web API



Udaiappa Ramachandran
NHDN-Nashua .NET/Cloud Computing UG Lead
Email: udaiappa@gmail.com
Blog: http://cloudycode.wordpress.com
Agenda
 Introduction to Web API
 Web API Routing
 Web API Pipeline
 Dependency Injections and Resolvers
 Model Binding and Media Formats
 Self Hosting
 Deploying Web API into cloud
 References
Introduction to Web API
 Next iteration of WCF REST
 Framework for developing REST Services
 Released part of ASP.NET MVC
 Uses HTTP protocol
 Accessible from wide variety of clients
 Http Methods: GET, POST, PUT, DELETE
 URLs and Methods
Demo: Web API Basics
Web API Routing
   Web API Routing very similar to MVC routing
   Action determined using the HTTP method not the URI path
   Uses “api” in the rout is to avoid collisons with ASP.NET MVC
    routing.
   Adds “Controller” to the controller part of the URL
   Default mapping thru global.asax
   Additional URL parameters are mapped as action parameters
   Explicitly specify the HTTP methods for an action by decorating
    the action method with HttpGet, HttpPut, HttpPost or
    HttpDelete attribute
   Action can be defined thru AcceptVerbs as a method attributes
   Route by Action Name
   Override action name by using ActionName attribute
   Ignore action by NoAction Attribute
Demo: Web API Routing
Filtering
   Uses OData specific keywords
               Directs that related records should be retrieved in the record or collection
    $expand
               being retrieved.
               Specifies an expression or function that must evaluate to ‘true’ for a record to
    $filter
               be returned in the collection.

    $orderby   Determines what values are used to order a collection of records.

    $select    Specifies a sub set of properties to return.

    $skip      Sets the number of records to skip before it retrieves records in a collection.


    $top       Determines the maximum number of records to return.


      Install-Package Microsoft.AspNet.WebApi.OData -Pre
Demo: Web API Filtering
Web API Pipeline
   Both Request and Response Model have pipeline
   Web API has client and server side pipelines
   Both Share the common object HttpMessageHandler
   HttpRequestMessage
     Represents all info about http request such as URL, HTTP Methods and
        Headers
   HttpResponseMessage
     Represents all the info about the Http Response such as StatusCode,
        Success Flag, Original Http Request
   HttpMessageHandler
       Common for both Request and Response
       Most common processing code can be placed here
       Ideal for authentication
       Two Scopes: Global and Per-Route
   Custom Handlers
     Inherit DelegatingHandler
     Custom code to perform any kind of per request functionality
Pipeline Elements
Pipeline Elements
Demo: Web API Pipeline
Demo: Custom Handlers
Dependency Resolution
 Service Oriented Architecture for Decoupling the
  object
 IoC: The concept of allowing something outside of
  system to control it.
 Often done thru DI frameworks
       Unity
       Ninject
       Castle Windsor
       Structure Map
       Spring.net
       Autofac
   Web API provides a hook for us to wire up the
    complex dependency
Demo: Simple Resolver
Demo: Resolve using DI Framework
Data Model and MIME types
   Returning JSON
     Default return format
     Good for mobile apps
     does not require any special code
   Returning XML
     No code change
     Set the request content type as application/xml
   Mime Types:
       return virtually anything that can be sent over the web
       Inherit from BufferedMediaTypeFormatter
       Override key methods
       attach media formatter to configuration
Demo: Data Model
Demo: MIME Types
Hosting
   IIS
    
    
    


   Self Hosting
    
    
    
    
Demo: Self Hosting
Resource
 http://cloudycode.wordpress.com
 http://www.asp.net/web-api/overview
 http://code.msdn.microsoft.com/ASPNET-Web-API-Self-
  Host-30abca12
 http://msdn.microsoft.com/en-us/library/gg309461.aspx
 http://blogs.msdn.com/b/webdev/archive/2012/08/26/asp-
  net-web-api-and-httpclient-samples.aspx
Q&A

More Related Content

What's hot

ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
Randy Connolly
 
Web api
Web apiWeb api
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
Sandeep Purohit
 
Backbone js
Backbone jsBackbone js
Backbone js
Knoldus Inc.
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
sivachandra mandalapu
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.netBhumivaghasiya
 
Request-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppRequest-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails App
Nathalie Steinmetz
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
IndicThreads
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400
himajareddys
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
Silverlight 2
Silverlight 2Silverlight 2
Silverlight 2
Dave Bost
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
begriffs
 
Data controls ppt
Data controls pptData controls ppt
Data controls pptIblesoft
 
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Hima Javvadi
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
Pramod Raghav
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
Reshi Unen
 

What's hot (20)

ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
Web api
Web apiWeb api
Web api
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Request-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails AppRequest-Response Cycle of Ruby on Rails App
Request-Response Cycle of Ruby on Rails App
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Silverlight 2
Silverlight 2Silverlight 2
Silverlight 2
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
 
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 

Viewers also liked

ZFConf 2010: Proposal Lifecycle
ZFConf 2010: Proposal LifecycleZFConf 2010: Proposal Lifecycle
ZFConf 2010: Proposal LifecycleZFConf Conference
 
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
Dealin Doug
 
Малобюджетный маркетинг
Малобюджетный маркетингМалобюджетный маркетинг
Малобюджетный маркетинг
evedy
 
Prk acta intercentos_13062012
Prk acta intercentos_13062012Prk acta intercentos_13062012
Prk acta intercentos_13062012oscargaliza
 
TDR - Predstavljanje poslovanja za 2009. godinu
TDR - Predstavljanje poslovanja za 2009. godinuTDR - Predstavljanje poslovanja za 2009. godinu
TDR - Predstavljanje poslovanja za 2009. godinu
TDR d.o.o Rovinj
 
Proyecto Cactus 1°3vesp
Proyecto Cactus 1°3vespProyecto Cactus 1°3vesp
Proyecto Cactus 1°3vespguest32ff1ff
 
LD_March2010_forweb
LD_March2010_forwebLD_March2010_forweb
LD_March2010_forweb
Latino Decisions
 
Yaşamboyu Öğrenme
Yaşamboyu ÖğrenmeYaşamboyu Öğrenme
Yaşamboyu Öğrenmenazzzy
 
Homophones Lesson
Homophones LessonHomophones Lesson
Homophones Lesson
jgd7971
 
Hyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van WouterHyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van Wouterguest2f17d3
 
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
Kalle
 
מכרות הגפרית בבארי
מכרות הגפרית בבארימכרות הגפרית בבארי
מכרות הגפרית בבאריhaimkarel
 
Goldberg Scanpath Clustering And Aggregation
Goldberg Scanpath Clustering And AggregationGoldberg Scanpath Clustering And Aggregation
Goldberg Scanpath Clustering And Aggregation
Kalle
 
Doing Business With Aboriginal People
Doing Business With Aboriginal PeopleDoing Business With Aboriginal People
Doing Business With Aboriginal PeopleLee_Ahenakew
 
Movie it process
Movie it processMovie it process
Movie it processSana Samad
 
Acta santiago barbanza
Acta santiago barbanzaActa santiago barbanza
Acta santiago barbanzaoscargaliza
 
MobileConf 2013 - Aerogear Android
MobileConf 2013 - Aerogear AndroidMobileConf 2013 - Aerogear Android
MobileConf 2013 - Aerogear AndroidDaniel Passos
 

Viewers also liked (20)

ZFConf 2010: Proposal Lifecycle
ZFConf 2010: Proposal LifecycleZFConf 2010: Proposal Lifecycle
ZFConf 2010: Proposal Lifecycle
 
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
DealinDougCommunity.com - ArapahoeOnline.com; 2009 AAA Aggressive Driving Res...
 
Adverts
AdvertsAdverts
Adverts
 
Малобюджетный маркетинг
Малобюджетный маркетингМалобюджетный маркетинг
Малобюджетный маркетинг
 
Prk acta intercentos_13062012
Prk acta intercentos_13062012Prk acta intercentos_13062012
Prk acta intercentos_13062012
 
TDR - Predstavljanje poslovanja za 2009. godinu
TDR - Predstavljanje poslovanja za 2009. godinuTDR - Predstavljanje poslovanja za 2009. godinu
TDR - Predstavljanje poslovanja za 2009. godinu
 
Proyecto Cactus 1°3vesp
Proyecto Cactus 1°3vespProyecto Cactus 1°3vesp
Proyecto Cactus 1°3vesp
 
LD_March2010_forweb
LD_March2010_forwebLD_March2010_forweb
LD_March2010_forweb
 
Yaşamboyu Öğrenme
Yaşamboyu ÖğrenmeYaşamboyu Öğrenme
Yaşamboyu Öğrenme
 
Homophones Lesson
Homophones LessonHomophones Lesson
Homophones Lesson
 
Hyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van WouterHyves Cbw Mitex Harry Van Wouter
Hyves Cbw Mitex Harry Van Wouter
 
Web 2 0
Web 2 0Web 2 0
Web 2 0
 
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
Komogortsev Qualitative And Quantitative Scoring And Evaluation Of The Eye Mo...
 
מכרות הגפרית בבארי
מכרות הגפרית בבארימכרות הגפרית בבארי
מכרות הגפרית בבארי
 
Goldberg Scanpath Clustering And Aggregation
Goldberg Scanpath Clustering And AggregationGoldberg Scanpath Clustering And Aggregation
Goldberg Scanpath Clustering And Aggregation
 
TEMA 1B GRAMMAR ADJECTIVES
TEMA 1B GRAMMAR ADJECTIVESTEMA 1B GRAMMAR ADJECTIVES
TEMA 1B GRAMMAR ADJECTIVES
 
Doing Business With Aboriginal People
Doing Business With Aboriginal PeopleDoing Business With Aboriginal People
Doing Business With Aboriginal People
 
Movie it process
Movie it processMovie it process
Movie it process
 
Acta santiago barbanza
Acta santiago barbanzaActa santiago barbanza
Acta santiago barbanza
 
MobileConf 2013 - Aerogear Android
MobileConf 2013 - Aerogear AndroidMobileConf 2013 - Aerogear Android
MobileConf 2013 - Aerogear Android
 

Similar to Web api

Implementation web api
Implementation web apiImplementation web api
Implementation web api
Zeeshan Ahmed Khalil
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
Binu Bhasuran
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
AMARAAHMED7
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Commit Software Sh.p.k.
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
Revelation Technologies
 
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
Luis Du Solier
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb 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
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
Http programming in play
Http programming in playHttp programming in play
Http programming in play
Knoldus Inc.
 

Similar to Web api (20)

Implementation web api
Implementation web apiImplementation web api
Implementation web api
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Day7
Day7Day7
Day7
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
 
08 ajax
08 ajax08 ajax
08 ajax
 
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb API with ASP.NET  MVC  by Software development company in india
Web API with ASP.NET MVC by Software development company in india
 
Asp.net
Asp.netAsp.net
Asp.net
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
Http programming in play
Http programming in playHttp programming in play
Http programming in play
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Web api

  • 1. ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua .NET/Cloud Computing UG Lead Email: udaiappa@gmail.com Blog: http://cloudycode.wordpress.com
  • 2. Agenda  Introduction to Web API  Web API Routing  Web API Pipeline  Dependency Injections and Resolvers  Model Binding and Media Formats  Self Hosting  Deploying Web API into cloud  References
  • 3. Introduction to Web API  Next iteration of WCF REST  Framework for developing REST Services  Released part of ASP.NET MVC  Uses HTTP protocol  Accessible from wide variety of clients  Http Methods: GET, POST, PUT, DELETE  URLs and Methods
  • 4. Demo: Web API Basics
  • 5. Web API Routing  Web API Routing very similar to MVC routing  Action determined using the HTTP method not the URI path  Uses “api” in the rout is to avoid collisons with ASP.NET MVC routing.  Adds “Controller” to the controller part of the URL  Default mapping thru global.asax  Additional URL parameters are mapped as action parameters  Explicitly specify the HTTP methods for an action by decorating the action method with HttpGet, HttpPut, HttpPost or HttpDelete attribute  Action can be defined thru AcceptVerbs as a method attributes  Route by Action Name  Override action name by using ActionName attribute  Ignore action by NoAction Attribute
  • 6. Demo: Web API Routing
  • 7. Filtering  Uses OData specific keywords Directs that related records should be retrieved in the record or collection $expand being retrieved. Specifies an expression or function that must evaluate to ‘true’ for a record to $filter be returned in the collection. $orderby Determines what values are used to order a collection of records. $select Specifies a sub set of properties to return. $skip Sets the number of records to skip before it retrieves records in a collection. $top Determines the maximum number of records to return. Install-Package Microsoft.AspNet.WebApi.OData -Pre
  • 8. Demo: Web API Filtering
  • 9. Web API Pipeline  Both Request and Response Model have pipeline  Web API has client and server side pipelines  Both Share the common object HttpMessageHandler  HttpRequestMessage  Represents all info about http request such as URL, HTTP Methods and Headers  HttpResponseMessage  Represents all the info about the Http Response such as StatusCode, Success Flag, Original Http Request  HttpMessageHandler  Common for both Request and Response  Most common processing code can be placed here  Ideal for authentication  Two Scopes: Global and Per-Route  Custom Handlers  Inherit DelegatingHandler  Custom code to perform any kind of per request functionality
  • 12. Demo: Web API Pipeline Demo: Custom Handlers
  • 13. Dependency Resolution  Service Oriented Architecture for Decoupling the object  IoC: The concept of allowing something outside of system to control it.  Often done thru DI frameworks  Unity  Ninject  Castle Windsor  Structure Map  Spring.net  Autofac  Web API provides a hook for us to wire up the complex dependency
  • 14. Demo: Simple Resolver Demo: Resolve using DI Framework
  • 15. Data Model and MIME types  Returning JSON  Default return format  Good for mobile apps  does not require any special code  Returning XML  No code change  Set the request content type as application/xml  Mime Types:  return virtually anything that can be sent over the web  Inherit from BufferedMediaTypeFormatter  Override key methods  attach media formatter to configuration
  • 17. Hosting  IIS     Self Hosting    
  • 18.
  • 20. Resource  http://cloudycode.wordpress.com  http://www.asp.net/web-api/overview  http://code.msdn.microsoft.com/ASPNET-Web-API-Self- Host-30abca12  http://msdn.microsoft.com/en-us/library/gg309461.aspx  http://blogs.msdn.com/b/webdev/archive/2012/08/26/asp- net-web-api-and-httpclient-samples.aspx
  • 21. Q&A