TTMSMCPResourceContent.FromText Method
Creates a content object holding text.
API unit family: TMS.MCP.Resources
Declaring type: TTMSMCPResourceContent
Syntax
class function FromText(const AURI, AMimeType, AText: string): TTMSMCPResourceContent; static;
Parameters
| Name | Description |
|---|---|
AURI |
Address the content was read from. Must not be empty. |
AMimeType |
Media type of the text, for example text/plain. May be left empty. |
AText |
The text itself. May be empty, which is sent as empty content rather than refused. |
Returns
A new content object. The caller owns it, and a handler that returns it hands that ownership on.
Exceptions
| Exception | Description |
|---|---|
EJsonRpcException |
Raised with invalid-parameters, error code -32602, when the address is empty. |