Designing Evolvable Web APIs with ASP.NET
by Glenn Block, Pablo Cibraro, Pedro Felix, Howard Dierking, Darrel Miller
Chapter 4. Processing Architecture
And now for something completely different.
The previous chapter presented the core ASP.NET Web API programming model, introducing the set of fundamental concepts, interfaces, and classes exposed by this framework. Before we address the book’s core subject of designing evolvable Web APIs, this chapter takes a short detour to look under the hood and present the underlying ASP.NET Web API processing architecture, detailing what happens between the reception of an HTTP request and the return of the corresponding HTTP response message. It also serves as a road map for the more advanced ASP.NET Web API features that we will be addressing in the third part of this book.
During this chapter we will be using the HTTP request presented in Example 4-1, associated with the controller defined in Example 4-2, as a concrete example to illustrate the runtime behavior of this architecture.
The ProcessesController contains a Get action that returns a representation of all the machine’s processes with a given image name.
The exemplifying HTTP request is a GET on the resource identified by http://localhost:50650/api/processes?name=explorer, which represents all the explorer processes currently executing.
GET http://localhost:50650/api/processes?name=explorer HTTP/1.1 User-Agent: Fiddler Host: localhost:50650 Accept: application/json
publicclassProcessesController:ApiController{publicProcessCollectionState ...