SlideShare a Scribd company logo
1 of 21
Download to read offline
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
    
    
    
    
Web api
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 ControlsRandy Connolly
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSandeep Purohit
 
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 azuresivachandra 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 AppNathalie Steinmetz
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVCIndicThreads
 
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'sAntônio Roberto Silva
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400himajareddys
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
Silverlight 2
Silverlight 2Silverlight 2
Silverlight 2Dave Bost
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophybegriffs
 
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 StudyHima Javvadi
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controlsReshi 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. godinuTDR d.o.o Rovinj
 
Proyecto Cactus 1°3vesp
Proyecto Cactus 1°3vespProyecto Cactus 1°3vesp
Proyecto Cactus 1°3vespguest32ff1ff
 
Yaşamboyu Öğrenme
Yaşamboyu ÖğrenmeYaşamboyu Öğrenme
Yaşamboyu Öğrenmenazzzy
 
Homophones Lesson
Homophones LessonHomophones Lesson
Homophones Lessonjgd7971
 
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 AggregationKalle
 
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

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 MVCSunpawet 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 FundamentalsIdo Flatow
 
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 applicationAMARAAHMED7
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan 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!Commit Software Sh.p.k.
 
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 Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
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 AnguloLuis 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 FeaturesPeter Gfader
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
 
Http programming in play
Http programming in playHttp programming in play
Http programming in playKnoldus 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
 
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
 
SCDJWS 5. JAX-WS
SCDJWS 5. JAX-WSSCDJWS 5. JAX-WS
SCDJWS 5. JAX-WS
 

Recently uploaded

AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 

Recently uploaded (20)

AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 

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    
  • 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