Skip to main content
Table of Contents

TTMSMCPResourceContent.FromText Method

Creates a content object holding text.

API unit family: TMS.MCP.Resources Declaring type: TTMSMCPResourceContent

Syntax

TMS.MCP.Resources.hppPascalC++
class function FromText(const AURI, AMimeType, AText: string): TTMSMCPResourceContent; static;
static TTMSMCPResourceContent* __fastcall FromText(const System::UnicodeString AURI, const System::UnicodeString AMimeType, const System::UnicodeString AText);

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.