SlideShare uma empresa Scribd logo
1 de 51
REST & ASP.NET Web API
        @JefClaes
Thanks to the sponsors
about/jefclaes




@jefclaes
http://jefclaes.be
REST
The acronym

REpresentational State Transfer
REST is NOT...

• ‘Webservices using JSON’

• A protocol
• A design pattern
REST is..



“An architectural style for building
distributed hypermedia systems.”
In theory...



  REST isn’t limited to a
single message protocol.
But in practice...



It’s all about HTTP.
So now you wonder..


Haven’t we been successfully building
 web services using SOAP and HTTP
         for over 10 years ?
BASIC CONCEPTS
Resources
• An entity, item, or just a thing you want to expose.
• REST is Resource Oriented.
Resources
Resources
Resources
Resources
Identifiers
Something that identifies a resource.

ID: 1
URI: http://batman.com/api/batresource/1
Representations
View on a resource’s state at an instant in time.

XML:                       JSON:                      Other:

<BatResource>              {                          •   Images
  <Id>1</Id>                 "Id":"1",                •   CSV
  <Description>              "Description":"Bataran   •   Custom
     Batarang              g",                        •   ...
  </Description>             "Quantity":1
  <Quantity>1</Quantity>   }
</BatResource>
Verbs
Actions on a resource.

Create Read Update Delete
POST GET PUT DELETE
Hypermedia
HATEOAS: Hypermedia as the engine of application state
Linking your API together
{
    "Id":"1",
    "Description":"Batarang",
    “Quantity":1,
    “Links":
       {
          "Rel":"Next",
           "Href":"http://localhost:8080/api/batresource/2"
        }
}
HypeRRRRRRRmedia
•   Relations
•   Embedded resources
•   Reference data
•   Redistribution of effort
•   Reduction of payload size
•   Reflow
•   Restriction of functionality
Architecture of the WEB
ARCHITECTURAL VALUES
Scalability and performance
Yes, text-based, synchronous, request-response
can be performant.
• Stateless
• Caching
Loose coupling
•   No transactions
•   No state
•   No guarantees
•   HATEOAS
•   No specific technology stack
Consistency and Uniformity

Everybody knows how to use HTTP
 –Constraints
 –Well understood semantics
LEFT-OVERS
Richardson’s Maturity Model

           Level 0: POX

       Level 1: Resources

    Level 2: HTTP verbs
 Level 3: Hypermedia
ASP.NET WEBAPI
What?


   .NET HTTP framework
       (4.0)



for building RESTful services.
When?
• HTTP Services (WCF)
• AJAX back-ends
The server
Options
• WebHost
  – ASP.NET MVC: Click, click, click
• SelfHost
Starting
Mapping Web API to
  REST concepts
A resource
A resource
Identifiers
Identifiers
Verbs
Verbs
Representations
Representations
application/json
text/xml
Representations
Hypermedia
Hypermedia
The Client
Package
Microsoft.AspNet.WebApi.Client
Verbs and asynchrony
Summary
• REST
   – Concepts
   – Architectual values
   – Left overs
• ASP.NET Web API
   – Server
   – Client
There is more
Slides and source on http://jefclaes.be

Extensibility?
• Next session (Raffaele Rialdi)
• http://github.com/JefClaes/aspnet-webapi-samples-tunisia
Please rate this session
Scan the code, go online, rate this session

Mais conteúdo relacionado

Mais procurados

Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
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
 
Designing REST services with Spring MVC
Designing REST services with Spring MVCDesigning REST services with Spring MVC
Designing REST services with Spring MVCSerhii Kartashov
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTPradeep Kumar
 
Restful webservice
Restful webserviceRestful webservice
Restful webserviceDong Ngoc
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transferTricode (part of Dept)
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHPZoran Jeremic
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service DesignLorna Mitchell
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reesebuildacloud
 

Mais procurados (20)

Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
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
 
Designing REST services with Spring MVC
Designing REST services with Spring MVCDesigning REST services with Spring MVC
Designing REST services with Spring MVC
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Web Services
Web ServicesWeb Services
Web Services
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
ASP.NET WEB API
ASP.NET WEB APIASP.NET WEB API
ASP.NET WEB API
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 

Destaque

OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlMaarten Balliauw
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIFilip W
 
Introdução ao ASP .NET Web API
Introdução ao ASP .NET Web APIIntrodução ao ASP .NET Web API
Introdução ao ASP .NET Web APIVinicius Mussak
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalAlessandro Pilotti
 
ASP.net Image Slideshow
ASP.net Image SlideshowASP.net Image Slideshow
ASP.net Image SlideshowHock Leng PUAH
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...Maarten Balliauw
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETPonraj
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 
Dcom vs. corba
Dcom vs. corbaDcom vs. corba
Dcom vs. corbaMohd Arif
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlMaarten Balliauw
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Netvidyamittal
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015Stuart
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introductionHock Leng PUAH
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTDr. Awase Khirni Syed
 

Destaque (20)

OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web API
 
Introdução ao ASP .NET Web API
Introdução ao ASP .NET Web APIIntrodução ao ASP .NET Web API
Introdução ao ASP .NET Web API
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 
ASP.net Image Slideshow
ASP.net Image SlideshowASP.net Image Slideshow
ASP.net Image Slideshow
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to HTML4
Introduction to HTML4Introduction to HTML4
Introduction to HTML4
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NET
 
C O R B A Unit 4
C O R B A    Unit 4C O R B A    Unit 4
C O R B A Unit 4
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Dcom vs. corba
Dcom vs. corbaDcom vs. corba
Dcom vs. corba
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Net
 
Asp.net
Asp.netAsp.net
Asp.net
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introduction
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 

Semelhante a REST and ASP.NET Web API (Milan)

Lies you have been told about REST
Lies you have been told about RESTLies you have been told about REST
Lies you have been told about RESTdarrelmiller71
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and JerseyChris Winters
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan UllahCefalo
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesKyle Banerjee
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Jackson F. de A. Mafra
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构Benjamin Tan
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.Andrey Oleynik
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - IntroductionHandsOnWP.com
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Brian Brazil
 

Semelhante a REST and ASP.NET Web API (Milan) (20)

Lies you have been told about REST
Lies you have been told about RESTLies you have been told about REST
Lies you have been told about REST
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and Jersey
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
 
REST API Design
REST API DesignREST API Design
REST API Design
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
 

Mais de Jef Claes

Evil By Design
Evil By DesignEvil By Design
Evil By DesignJef Claes
 
The Ubiquitous Language DDDBE V2
The Ubiquitous Language DDDBE V2The Ubiquitous Language DDDBE V2
The Ubiquitous Language DDDBE V2Jef Claes
 
NCrafts Eventstorming workshop
NCrafts Eventstorming workshopNCrafts Eventstorming workshop
NCrafts Eventstorming workshopJef Claes
 
What if we stored events instead of state?
What if we stored events instead of state?What if we stored events instead of state?
What if we stored events instead of state?Jef Claes
 
The Ubiquitous Language
The Ubiquitous LanguageThe Ubiquitous Language
The Ubiquitous LanguageJef Claes
 
Workshop event storming
Workshop event stormingWorkshop event storming
Workshop event stormingJef Claes
 
Refactoring towards the ubiquitous language
Refactoring towards the ubiquitous languageRefactoring towards the ubiquitous language
Refactoring towards the ubiquitous languageJef Claes
 
WebSockets On Fire
WebSockets On FireWebSockets On Fire
WebSockets On FireJef Claes
 

Mais de Jef Claes (8)

Evil By Design
Evil By DesignEvil By Design
Evil By Design
 
The Ubiquitous Language DDDBE V2
The Ubiquitous Language DDDBE V2The Ubiquitous Language DDDBE V2
The Ubiquitous Language DDDBE V2
 
NCrafts Eventstorming workshop
NCrafts Eventstorming workshopNCrafts Eventstorming workshop
NCrafts Eventstorming workshop
 
What if we stored events instead of state?
What if we stored events instead of state?What if we stored events instead of state?
What if we stored events instead of state?
 
The Ubiquitous Language
The Ubiquitous LanguageThe Ubiquitous Language
The Ubiquitous Language
 
Workshop event storming
Workshop event stormingWorkshop event storming
Workshop event storming
 
Refactoring towards the ubiquitous language
Refactoring towards the ubiquitous languageRefactoring towards the ubiquitous language
Refactoring towards the ubiquitous language
 
WebSockets On Fire
WebSockets On FireWebSockets On Fire
WebSockets On Fire
 

REST and ASP.NET Web API (Milan)