
Services interact with many devices and browsers. Use ASP.NET Web APIs to build scalable HTTP services for virtually any device with Internet connectivity.
Services need to comply with specific constraints to be considered RESTful. Identify the REST constraints required for a service to be considered RESTful.
Why favor ASP.NET Web APIs over WCF in some scenarios. Identify the differences between WCF and Web APIs to know when to use which.
There are many (messy) ways to create APIs. Implement the Uniform Interface to conform to RESTful standards for simpler interaction.
Working with APIs requires access to specific request properties. The APIController includes all the properties needed to access and modify the request.
Avoid complex configurations. Use a convention-based approach for implementing the Uniform Interface in REST.
Override the convention model. Specify custom method names and routes by using the appropriate attributes.
Get a more hands-on experience with Web APIs. Prepare to build a real-world example using Web APIs.
Get familiar with the project structure. Explore the project structure and add folders for future use.
Follow standard architectural patterns. Create models and interfaces to implement the repository and unit of work patterns.
Understand how to create endpoints for the service. Create controllers as API endpoints for the service.
Make sure all the API endpoints work as expected. Use Fiddler to debug the service.
Control the access to your Web APIs. Secure your Web APIs from unauthorized users.
Apply the right type of authentication for the scenario. Understand the differences between each type of authentication.
Customize Basic Authentication in ASP.NET Web APIs. Create an HTTP message handler to validate the user's credentials.
Enhance the security of your API. Force the use of HTTPS and enable SSL.
Serve and support many content types within your Web APIs. Add custom media type formatters to your service.
Prevent DoS attacks. Use message handlers to implement rate limiting.
Prevent null values to be sent as responses. Make use of filters to intercept and check responses and return appropriate messages.
Use the Service Locator pattern. Implement IDependencyResolver to pass instances for controllers.
Allow clients to perform dynamic queries on the data. Make use of and implement the Odata protocol.
Take the difficulty out of consuming HTTP services by using the HttpClient.
Add custom headers to outgoing requests by creating a HttpClientHandler.
Prevent repetitive complex code and create a custom HttpClient for consuming The Book Store service.
Make the app interact with The Book Store and write the code to use the custom HttpClient for consuming the service.
Take the pain out of keeping documentation up-to-date by using automatic help pages.
Add additional information to documented endpoints. Use the XML documentation function to do this.
Allow users to take the APIs for a test drive. Include a test client for testing purposes.
Customize your documentation by getting familiar with how Help Pages work.
Choose the best option for hosting a Web API solution. Understand the different hosting options available.
Host ASP.NET Web APIs independently by using self-hosting.
Add true abstraction by using OWIN hosting to decouple a web application from the server.
Simplify your hosting by deploying to Azure.
Mitigate complex configuration by using the publish profile from your website in the cloud to deploy.
This video course is a great starting point for any web developer who wants to create simple web APIs in minutes. By applying your knowledge of ASP.NET in conjunction with the information provided in this video tutorial, you will learn to master the art of building RESTful services by example.
The video course begins with a brief introduction that will soon get you up to speed with the framework, and will then get you building a fully-functional Web API from scratch during the course of the tutorial.
You will learn some of the important features of ASP.NET Web API and how it aligns to the REST standard. You will explore the different implementation strategies and get familiar with some security implementations and ways to extend your APIs, including how to wire up the client side to the service. The tutorial also contains information on automatic documentation generation and deployment strategies such as publishing to Azure.
This video tutorial provides you with a comprehensive, clear, and easy-to-follow guide to creating RESTful services with ASP.NET Web API.
Fanie Reynders is a Microsoft Certified Professional from South Africa and a web Technology Evangelist in his own right, with over 9 years of development experience on the Microsoft stack. He actively writes and speaks about the technology he loves to anyone who is willing to listen and has recently been featured in the DNC Magazine, as well as presenting at Microsoft Dev4Devs conference.