Introduction to NET Florin Olariu Alexandru Ioan Cuza

























- Slides: 25
Introduction to. NET Florin Olariu “Alexandru Ioan Cuza”, University of Iași Department of Computer Science
ASP. NET Web API - II
Agenda Status codes recap Demo : How to return child resources Demo : Working with serializer settings Content negotiation Demo: Content negotiation Demo : Creating a resource Demo : Validating input Demo : Updating a resource Demo : Deleting a resource Best practices in Web API’s Summary
Status codes recap
Status codes recap
Demo : How to return child resources
Demo : Working with serializer settings
Content negotiation
Content negotiation Formatters and Content negotiation
Content negotiation Formatters and Content negotiation The idea is selecting the best representation for a given response when the are multiple representation available.
Content negotiation Formatters and Content negotiation The idea is selecting the best representation for a given response when the are multiple representation available. Pass media type via the accept header of the request
Content negotiation Formatters and Content negotiation The idea is selecting the best representation for a given response when the are multiple representation available. Pass media type via the accept header of the request application/json application/xml
Content negotiation
Content negotiation
Demo: Content negotiation
Demo : Creating a resource
Demo : Validating input Model. State Data validation For custom validations make use of Fluent Validation https: //www. nuget. org/packages/Microsoft. Asp. Net. Web. Api. Core/ https: //www. exceptionnotfound. net/custom-validation-in-asp-net-web-api-withfluentvalidation/
Demo : Updating a resource
Demo : Deleting a resource
One more thing…(1/2)
One more thing…(2/2) Best practices for API’s https: //medium. com/@schneidenbach/restful-api-best-practices-andcommon-pitfalls-7 a 83 ba 3763 b 5#. 6 wmaehuhu
Summary Recap status codes Formatters and content negotiation Creating/updating/deleting updating resources Best practices
Bibliography Pluralsight
Questions Do you have any other questions?
Thanks! See you next time!