TTMSMCPResource.ReadResource Method
Runs the handler for an address and converts what it produces into the content object sent back to the client.
API unit family: TMS.MCP.Resources
Declaring type: TTMSMCPResource
Syntax
function ReadResource(const ARequestURI: string): TJSONValue;
Remarks
The content the handler returns is converted and then freed here, so the handler must hand over a fresh instance. An entry with no handler raises an internal error, error code -32603; a handler that returns nothing or that raises raises a failed operation, error code -32004, carrying the reason. A protocol error raised inside the handler is passed through with its own code intact.
Parameters
| Name | Description |
|---|---|
ARequestURI |
Address that was requested. For a template entry this is the expanded address, which is passed to the handler unchanged. |
Returns
A new object holding the address, the media type and either the text or the encoded binary content. The caller owns it.