Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
Building rest services using aspnetwebapi
1. Building Rest Services Using
ASP.NET Web API
Brij Bhushan Mishra
http://codewala.net @code_wala https://www.facebook.com/codewala
2. About Me
• Brij Bhushan Mishra
• 5 times Microsoft MVP - ASP.NET/IIS
• Architect/Consultant/ SME
• Avid Blogger/ Author/ Reviewer
• Speaker at top Conferences including GIDS,
TechEd, C# Corner Conference and many more
• Work closely with various organizations as SME, Content developer, Speaker,
Community Tech Reviewer
• http://codewala.net
• @code_wala
• https://www.facebook.com/codewala
http://codewala.net @code_wala https://www.facebook.com/codewala
3. What is REST ?
http://codewala.net @code_wala https://www.facebook.com/codewala
5. Why are we talking about Rest?
• To Understand it, let’s talk about WCF and its working
SOAPSOAPSOAP
http://codewala.net @code_wala https://www.facebook.com/codewala
6. What is Rest?
• Rest is an Architectural Style
Kalinga Architecture
MughalArchitecture
http://codewala.net @code_wala https://www.facebook.com/codewala
7. Rest Constraints
• Client Server
• Stateless server
• Cacheable
• Uniform Interface
• Layered System
• Code on Demand
http://codewala.net @code_wala https://www.facebook.com/codewala
11. Uniform Interface
• Identification of a resource
• Each resource should be identified by an Id (api/books/{id})
• Manipulation of resources through representations
• Same representations should be sent back as are received via API
• Uses the standard HTTP verbs for the operation
http://codewala.net @code_wala https://www.facebook.com/codewala
13. Why REST?
• Uses HTTP. Less Overhead and lightweight
• Content negotiation
• JSON vs XML
• Any Data from Any Where
http://codewala.net @code_wala https://www.facebook.com/codewala
14. What is ASP.NET Web API?
ASP.NET Web API is framework that enables to write REST based
services.
http://codewala.net @code_wala https://www.facebook.com/codewala
15. HTTP Verbs
• GET (Reading the resource)
• POST (Create a resource)
• PUT (Update a resource)
• DELETE (Delete a resource)
• PATCH (Update a resource)
http://codewala.net @code_wala https://www.facebook.com/codewala
16. Key Characteristics – Defining a Resource
• Collection or single
../api/bookstore/books or /api/bookstore/books/{id}
• Noun (not a verb)
• Navigation (for associated items)
• In Web API, Noun is typically a controller
http://codewala.net @code_wala https://www.facebook.com/codewala
17. Earlier versions of ASP.NET
http://codewala.net @code_wala https://www.facebook.com/codewala
22. What we covered today
• What is not REST
• REST Constraints
• What is ASP.NET Web API
• HTTP Verbs
• ASP.NET Core ( MVC = MVC + Web API)
• POSTMAN
• Demo.. Demo..
http://codewala.net @code_wala https://www.facebook.com/codewala