Comments (6)
From Chrome:
GET /foo
Request comes with no headers and text/html
as PreferredMimeType, arriving at AppsBootstrapper.ProcessExternalRequest
(invoked from gateway).
from misc.
First, any request filters are given a chance on the request. No such filters installed.
from misc.
With no request filters taking action, the server now give control to the handler, with a call to AppRestServer.RunDelegateAndProcessResponse
, that in turn invoke UserHandlerInfo.RunUserDelegate
.
In that method, with our setup, we don't have proxy delegate and neither any substitute handler, so finally the call enters our custom, user defined handler that return our Json
. When doing so, the implicit cast from Json
to Response
take place, and by that, the Response
produced is referencing our Json
as an IResource
.
Since StarcounterEnvironment.MergeJsonSiblings
is set, the installed Response.ResponsesMergerRoutine_
is now invoked, in our case referencing UriMapping.DefaultJsonMerger
. That method doesn't perform any merge, since in our case, we have a single JSON response. It assign the object the app name and sets internal _wrapInAppName
to true
(not sure what that does).
from misc.
Control is now back in AppRestServer.RunDelegateAndProcessResponse
after the above detour. We have a Response
instance that reference our Json
instance, and the server now issue SendResponse
on our request object.
from misc.
The server now runs any response filters, but in our case, none is registered.
After some global state is transferred to the response object, Response.ConstructFromFields
is invoked.
from misc.
Response.ConstructFromFields
Builds up the byte[]
that are to be sent back to the agent. The array is composed by inspecting the heap data (instance variables) of the current response object.
In our case, the response object reference an IResource
instance (our JSON). The response is hence created by asking that instance to return itself as a representation that match the agents preferred MIME type (text/html
).
from misc.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from misc.