Book description
ASP.NET Web API Recipes provides you with the code to solve a full range of Web API problems and question marks that you might face when developing line-of-business applications. ASP.NET Web API Recipes gives you an in-depth explanation for each of these scenarios and shows you how to use Web API with a vast array of .NET application development tools and external libraries, to solve common business problems. Find out how you can build custom web services with ASP.NET Web API more efficiently than ever.
Table of contents
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgements
- Introduction
-
Chapter 1: Web API in ASP.NET
- 1-1. Add ASP.NET Web API to an MVC Application
- 1-2. Add ASP.NET Web API to a Web Forms Application
- 1-3. Accept an HTML Form
- 1-4. Link from MVC Controller to API Controller and Vice Versa
- 1-5. Use Scaffolding with ASP.NET Web API
- 1-6. Add Model Validation
- 1-7. Use CSRF Protection
- 1-8. Add Support for Session State
- Chapter 2: ASP.NET Web API Outside of IIS
-
Chapter 3: Routing
- 3-1. Define Centralized Routes
- 3-2. Define Direct Routes
- 3-3. Set Default Route Values
- 3-4. Set Optional Route Values
- 3-5. Set Route Constraints
- 3-6. Define Remote Procedure Call Style Routes
- 3-7. Create Catch-all Routes
- 3-8. Prevent Controller Methods from Inadvertently Becoming Web API Endpoints
- 3-9. Configure Route-Specific Message Handlers
- 3-10. Ignore Routes
- 3-11. Localize Routes
- 3-12. Generate a Link to the Route
-
Chapter 4: Content Negotiation and Media Types
- 4-1. Request a Specific Media Type from ASP.NET Web API
- 4-2. Support Additional Media Types
- 4-3. Control Model Binding From URI and Body
- 4-4. ASP.NET MVC-style Parameter Bindingin ASP.NET Web API
- 4-5. Customize XML and JSON Responses
- 4-6. Write Your Own MediaTypeFormatter
- 4-7. Run Content Negotiation Manually
- 4-8. Bypass Content Negotiation
- 4-9. Control Media Types with MediaTypeMappings
- 4-10. Serve Binary Data from ASP.NET Web API
- 4-11. Accept File Uploads
- 4-12 Enable Bufferless Uploads
- 4-13 Validate File Uploads
-
Chapter 5: Configuration and Customization
- 5-1. Throttle ASP.NET Web API Calls
- 5-2. Use Controllers from an External Assembly
- 5-3. Use Controller-Scoped Configuration
- 5-4. Validate Input with Action Filters
- 5-5. Override Filters
- 5-6. Add Caching to ASP.NET Web API
- 5-7. Use an Existing Caching Library
- 5-8. Order Filter Execution with Custom Filters
- 5-9. Order Filter Execution Without Custom Filters
- 5-10. Customize Error Detail Policy
- 5-11. Return HTML from ASP.NET Web API
- 5-12. Store Objects for the Duration of HTTP Request
-
Chapter 6: Embrace HTTP with ASP.NET Web API
- 6-1. Work Directly with HttpRequestMessage
- 6-2. Support Partial GET
- 6-3. Support the HEAD Verb
- 6-4. Support the PATCH Verb
- 6-5. Support Batching of HTTP Requests
- 6-6. Automatic HTTP 406/Not Acceptable Server Responses
- 6-7. Implement Versioning of a Web API with Centralized Routes
- 6-8. Implement Versioning of a Web API with Attribute Routing
- 6-9. Use Custom HTTP Content
-
Chapter 7: Exceptions, Troubleshooting, and Documenting
- 7-1. Handle Exceptions with Filters
- 7-2. Handle Exceptions Globally
- 7-3. Log Exceptions Globally
- 7-4. Add a Tracer
- 7-5. Use an External Tracer
- 7-6. Call the Tracer Manually
- 7-7. Write a Real-Time Tracer
- 7-8. Create a Documentation Page for ASP.NET Web API
- 7-9. Add Custom Samples to ASP.NET Web API Help Page
- 7-10. Add Filters Information to ASP.NET Web API Help Page
- 7-11. Support Data Annotations in ASP.NET Web API Help Page
-
Chapter 8: Cross Domain and Push Communication
- 8-1. Use JSONP in ASP.NET Web API
- 8-2. Use CORS in ASP.NET Web API
- 8-3. Create Custom CORS Policies
- 8-4. Support Streaming and Push from ASP.NET Web API
- 8-5. Support Server-Sent Events in ASP.NET Web API
- 8-6. Integrate ASP.NET SignalR into ASP.NET Web API controllers
- 8-7. Use WebSockets with ASP.NET Web API
- Chapter 9: Dependency Injection
-
Chapter 10: Securing an ASP.NET Web API Service
- 10-1. Use Correct Web API Components for Security-Related Tasks
- 10-2. Add HTTPS Support to ASP.NET Web API
- 10-3. Use Basic Authentication
- 10-4. Integrate Windows Authentication
- 10-5. Use the Hawk Authentication Scheme
- 10-6. Use OAuth 2.0 with ASP.NET Web API
- 10-7. Safely Access Current IPrincipal
- 10-8. Remove ASP.NET Web API Server Footprint
- Chapter 11: Testing Web API Services
- Chapter 12: OData
- Index
Product information
- Title: ASP.NET Web API 2 Recipes: A Problem Solution Approach
- Author(s):
- Release date: August 2014
- Publisher(s): Apress
- ISBN: 9781430259817
You might also like
book
ASP.NET Web API 2: Building a REST Service from Start to Finish
The ASP.NET MVC Framework has always been a good platform on which to implement REST-based services, …
book
Expert ASP.NET Web API 2 for MVC Developers
Web API 2 is the latest evolution of Microsoft's web services toolkit, which allows the creation …
book
Pro ASP.NET Web API: HTTP Web Services in ASP.NET
Pro ASP.NET Web API shows you how to build flexible, extensible web services that run seamlessly …
video
Building Web APIs with ASP.NET 4.5
This course shows entry to mid-level Visual Studio developers how to create customized REST Web APIs …