Request

An RPC request constructed by the client to send to the RPC server.

The Request contains the ID of the request, the method to call, and any parameters to pass to the method. You should not need to manually create a Request object; the RPCClient will do this for you.

Constructors

this
this(T id, string method, JSONValue params = JSONValue())

Construct a Request with the specified remote method name and arguments.

this
this(JSONValue id, string method, JSONValue params)

Construct a Request with the specified remote method name and arguments.

this
this(string method, JSONValue params = JSONValue())

Construct a notification with the specified remote method name and arguments.

this
this(T id, string method, string params)

Construct a Request with the specified remote method name and arguments.

Members

Functions

toJSONString
string toJSONString(Flag!"prettyPrint" prettyPrint = No.prettyPrint)

Convert the Request to a JSON string to pass to the server.

Properties

id
auto id [@property getter]

Get the ID of this request.

idType
JSON_TYPE idType [@property getter]

Get the type of the underlying ID. There is no type for notifications.

isNotification
bool isNotification [@property getter]

Return true if this request is a notification; otherwise, return false.

Static functions

fromJSONString
Request fromJSONString(const char[] str)

Parse a JSON string into a Request object.

Meta