<< Click to Display Table of Contents >> Navigation: »No topics above this level« Requests dispatch |
All requests are dispatched to registered request handlers using first element in URL path.
For example, it URL llooks like
https://myserver.com/this/is/my/document
Request will be dispatched by "this" part.
There are three dispatchers:
Dispatch - for any user
AuthDispatch - for authorized users only
AdminDispatch - for administrators only,
Server tries to find handler in Dispatch, then in AuthDispatch (if user is authorized) and at last in AdminDispatch if user is Administrator.
Handler method has the following declaration:
procedure RequestHandler(Request: TWebUIRequest) of object.
To register it call
*Dispatch.Add(Key, Handler).
Normally handlers should fill the following fields of Request:
OutCountent: string or OutContentBytes: TBytes;
OutContentType: string - MIME content type and encoding (default text/html;charset:utf-8)
ResponseCode: integer - HTTP response code (default 200)