9781449337711
index.html

Designing Evolvable Web APIs with ASP.NET

Glenn Block

Pablo Cibraro

Pedro Felix

Howard Dierking

Darrel Miller


Preface
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
1. Web APIs and The Web Architecture
What is a Web API?
Origins of Web APIs
2005, The Web API revolution begins
Paying attention to the Web
Web Architecture
Resource
URI
Cool URIs
Representation
Media Type
Multiple representations
HTTP
Moving beyond HTTP 1.1
HTTP Message Exchange
Intermediaries
Types of Intermediaries
HTTP Methods
Headers
HTTP Status Codes
Content Negotiation
Caching
Authentication
Authentication Schemes
Delegated Authorization
APIS
API Styles
The Richardson Maturity Model
RPC (RMM Level 0 and 1)
Resource Oriented (RMM Level 2)
Hypermedia (RMM Level 3)
REST
2. ASP.NET Web API 101
Core Scenarios
First Class HTTP Programming
Symmetric client and server programming experience
Flexible support for different formats
Stop “coding with angle brackets”
Unit-testable
Multiple hosting options
Getting Started with ASP.NET Web API
Exploring a New Web API Project
“Hello Web API!”
Creating the Service
The Client
The Host
Conclusion
3. Processing Architecture
The Hosting layer
Message handler pipeline
Route dispatching
Controller Handling
The ApiController base class
Conclusion
4. The Application
5. Media Type Selection and Design
6. Building the client
7. Hosting
Web hosting
The ASP.NET infrastructure
ASP.NET Routing
Web API routing
Global configuration
The Web API ASP.NET Handler
Self-hosting
WCF architecture
The HttpSelfHostServer class
The HttpSelfHostConfiguration class
URL reservation and access control
Azure Service Bus Host
In-memory hosting
OWIN
What is OWIN
OWIN Core Concepts
8. Formatters and Model Binding
Why Models should matter in your Web API?
A first glance at Model Binding
Value Providers
Implementing a Value Provider
Model Binders
Implementing a Model Binder
The FromUri and FromBody attributes
Formatters
Implementing a MediaTypeFormatter
Model Validation
Applying Data Annotations attributes to a model
Querying the validation results
Summary
9. HttpClient
Background
HttpClient Class
Lifecycle
Wrapper
Multiple Instances
Thread Safe
Helper methods
Peeling off the layers
Completed requests don’t throw
Content is everything
Cancelling the request
SendAsync
HttpRequestMessage
Headers
HttpResponseMessage
Headers
HttpContent
Headers
Custom HttpContent Classes
Client MessageHandlers
Building Reactive clients
Routing responses through a common path
Breaking the request response pair.
Creating resuable response handlers
10. Security
Transport security
Creating development keys and certificates
Using TLS in ASP.NET Web API
Authentication
Server authentication
Client identity representation
TLS-based client authentication
The HTTP authentication framework
The OAuth 2.0 Authorization Framework
An example
The Authorization Endpoint
The Token Endpoint
The Framework
11. Testability
Unit Tests
Unit Testing Frameworks
Getting started with Unit Testing
The role of unit testing in Test Driven Development
Unit testing your ASP.NET Web API
Unit Testing a ApiController
Unit Testing a MediaTypeFormatter
Unit Testing a HttpMessageHandler
Integration Tests in ASP.NET Web API
12. Appendix
Appendix A - Media Types
Appendix B - HTTP Headers
13. Changelog
01-01-2013
01-07-2013
Site last updated on: January 7, 2013 at 04:23:24 AM PST
Cover for Designing Evolvable Web APIs with ASP.NET