Your SlideShare is downloading. ×
REST and ASP.NET Web API (Milan)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

REST and ASP.NET Web API (Milan)

5,040

Published on

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,040
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
44
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. REST & ASP.NET Web API @JefClaes
  • 2. Thanks to the sponsors
  • 3. about/jefclaes@jefclaeshttp://jefclaes.be
  • 4. REST
  • 5. The acronymREpresentational State Transfer
  • 6. REST is NOT...• ‘Webservices using JSON’• A protocol• A design pattern
  • 7. REST is..“An architectural style for buildingdistributed hypermedia systems.”
  • 8. In theory... REST isn’t limited to asingle message protocol.
  • 9. But in practice...It’s all about HTTP.
  • 10. So now you wonder..Haven’t we been successfully building web services using SOAP and HTTP for over 10 years ?
  • 11. BASIC CONCEPTS
  • 12. Resources• An entity, item, or just a thing you want to expose.• REST is Resource Oriented.
  • 13. Resources
  • 14. Resources
  • 15. Resources
  • 16. Resources
  • 17. IdentifiersSomething that identifies a resource.ID: 1URI: http://batman.com/api/batresource/1
  • 18. RepresentationsView 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>
  • 19. VerbsActions on a resource.Create Read Update DeletePOST GET PUT DELETE
  • 20. HypermediaHATEOAS: Hypermedia as the engine of application stateLinking your API together{ "Id":"1", "Description":"Batarang", “Quantity":1, “Links": { "Rel":"Next", "Href":"http://localhost:8080/api/batresource/2" }}
  • 21. HypeRRRRRRRmedia• Relations• Embedded resources• Reference data• Redistribution of effort• Reduction of payload size• Reflow• Restriction of functionality
  • 22. Architecture of the WEBARCHITECTURAL VALUES
  • 23. Scalability and performanceYes, text-based, synchronous, request-responsecan be performant.• Stateless• Caching
  • 24. Loose coupling• No transactions• No state• No guarantees• HATEOAS• No specific technology stack
  • 25. Consistency and UniformityEverybody knows how to use HTTP –Constraints –Well understood semantics
  • 26. LEFT-OVERS
  • 27. Richardson’s Maturity Model Level 0: POX Level 1: Resources Level 2: HTTP verbs Level 3: Hypermedia
  • 28. ASP.NET WEBAPI
  • 29. What? .NET HTTP framework (4.0)for building RESTful services.
  • 30. When?• HTTP Services (WCF)• AJAX back-ends
  • 31. The server
  • 32. Options• WebHost – ASP.NET MVC: Click, click, click• SelfHost
  • 33. Starting
  • 34. Mapping Web API to REST concepts
  • 35. A resource
  • 36. A resource
  • 37. Identifiers
  • 38. Identifiers
  • 39. Verbs
  • 40. Verbs
  • 41. Representations
  • 42. Representationsapplication/jsontext/xml
  • 43. Representations
  • 44. Hypermedia
  • 45. Hypermedia
  • 46. The Client
  • 47. PackageMicrosoft.AspNet.WebApi.Client
  • 48. Verbs and asynchrony
  • 49. Summary• REST – Concepts – Architectual values – Left overs• ASP.NET Web API – Server – Client
  • 50. There is moreSlides and source on http://jefclaes.beExtensibility?• Next session (Raffaele Rialdi)• http://github.com/JefClaes/aspnet-webapi-samples-tunisia
  • 51. Please rate this sessionScan the code, go online, rate this session

×