TTMSMCPClientTransportHTTP.Send Method
Posts one JSON-RPC message to
URL.
API unit family: TMS.MCP.Client.Transport.HTTP
Declaring type: TTMSMCPClientTransportHTTP
Overloads
Overload 1
Posts one JSON-RPC message to
URL.
procedure Send(const AJsonRpc: string); overload; override;
Remarks
The message is read to find the method it invokes and, among its arguments, the name or the identifier of the target that method acts on; both are then passed to the other overload so that they can travel as request metadata. A message that names no such target simply leaves that metadata empty. Does nothing when the transport is not running. The message is posted by a background worker, so the call returns before the server has answered.
Parameters
| Name | Description |
|---|---|
AJsonRpc |
Message to send, already serialized as JSON. |
Overload 2
Posts one JSON-RPC message to
URL, naming the request it carries so that the server sees it without parsing the payload.
procedure Send(const AJsonRpc: string; AMethod: string; ANameOrUri: string); overload; override;
Remarks
Does nothing when the transport is not running. The message is handed to a background worker of its own and the call returns immediately, so messages sent in quick succession are in flight together and their answers may be reported out of order. The request carries the agreed protocol revision, the session identifier once one is known, and an authorization header when a valid access token is held. The two metadata values are omitted when the connection runs in the older-revision mode, which does not define them.
Parameters
| Name | Description |
|---|---|
AJsonRpc |
Message to send, already serialized as JSON. |
AMethod |
Method name the message invokes, sent as request metadata. |
ANameOrUri |
Name or identifier of the target the method acts on, sent as request metadata. Pass an empty value when the method has no such target. |