• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
REST and ASP.NET Web API (Tunisia)
 

REST and ASP.NET Web API (Tunisia)

on

  • 3,399 views

Slides from my session on REST and ASP.NET Web API at the Euricom Tunisia trip.

Slides from my session on REST and ASP.NET Web API at the Euricom Tunisia trip.

Statistics

Views

Total Views
3,399
Views on SlideShare
2,717
Embed Views
682

Actions

Likes
1
Downloads
61
Comments
0

6 Embeds 682

http://www.jefclaes.be 650
http://feeds.feedburner.com 19
http://1165127106246535168_7af8341a2f5f4b26990212953a60909287ade2c8.blogspot.com 10
http://xandros 1
http://www.linkedin.com 1
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Batbelt?

REST and ASP.NET Web API (Tunisia) REST and ASP.NET Web API (Tunisia) Presentation Transcript

  • REST &ASP.NET Web API By @JefClaes
  • REST
  • The acronymREpresentational State Transfer
  • REST is NOT...• „Webservices using JSON‟• A protocol• A design pattern
  • REST is...“An architectural style for buildingdistributed hypermedia systems.”
  • In theory... REST isn‟t limitedto a single message protocol.
  • But in practice...It‟s all about HTTP.
  • So now you wonder..Haven‟t we been successfully buildingweb 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. A bank
  • IdentifiersSomething that identifies a resource.BIC (= Bank Identifier Code): KREDBEBBURI: http://myapi.com/bank/KREDBEBB
  • RepresentationsView on a resource‟s state at an instant in time.XML: JSON: Other:<Bank> { • Images <BIC>KREDBEBB</BIC> "BIC":"123“, • CSV <Name>KBC</Name> “Name”:”KBC” • Custom</Bank> } • ...
  • VerbsActions on a resource.Read, Update, Delete, AddGET, PUT, DELETE, POST
  • HypermediaHATEOAS: Hypermedia as the engine of application stateLinking your API together
  • Architecture of the WEBARCHITECTURAL VALUES
  • Scalability and performanceYes, text-based, synchronous, request-responsecan be performant.• Stateless• Caching
  • Loose coupling• No transactions• No state• No guarantees• HATEOAS• No specific technology stack
  • Consistency and UniformityEverybody knows how to use HTTP – Constraints – Well understood semantics
  • LEFT-OVERS
  • Richardson‟s Maturity Model Level 0: POX Level 1: Resources Level 2: HTTP verbsLevel 3: Hypermedia
  • Questions?
  • ASP.NET WEBAPI
  • What? .NET (4.0) HTTP frameworkfor building RESTful services.
  • When?• HTTP Services (WCF)• AJAX back-ends
  • The server
  • Options• ASP.NET MVC – Click, click, click• SelfHost
  • Selfhost
  • PackagesMicrosoft.AspNet.WebApi.SelfHost
  • Starting
  • Simple CRUD
  • Creating a controller
  • Creating a controller
  • Without conventions• Attributes [HttpGet]• [NonAction]
  • The Client
  • PackagesMicrosoft.AspNet.WebApi.Client
  • POST and GET
  • Exception handling
  • Default behaviour & IncludeErrorDetailPolicy• By default 500 Internal Server Error
  • HttpResponseException
  • ErrorFilters
  • Content negotiation
  • XML/JSONSupported out of the box:• text/xml• application/json (NewtonSoft)
  • Custom formatters
  • Custom formatters
  • HTTPMessagehandlers
  • HTTP intermediaries
  • DelegatingHandler
  • DelegatingHandler
  • IoC
  • IDependencyResolver
  • IDependencyResolver
  • Testing
  • Unit testig
  • Integration testing in-memory
  • Summary• REST – Concepts – Architectual values – Left overs• ASP.NET Web API – Server/client – Exception handling – Content negotiation – Message handlers – IoC – Testing
  • Questions