Class JsonRpcResponse<TResult>
a JSON-RPC server response which may either indicate success, with an arbitrary response object, or an error
with a corresponding
JsonRpcError instance describing the error.
Inheritance
JsonRpcResponse<TResult>
Assembly: XploRe.Net.JsonRpc.dll
Syntax
public class JsonRpcResponse<TResult> : JsonRpcMessage, IJsonRpcResponse<TResult>, IJsonRpcMessage, IHasProtocolVersion
Type Parameters
Name |
Description |
TResult |
The expected type of the response result on success. If the result returned by the server cannot be
converted to the requested type, a Newtonsoft.Json.JsonSerializationException is thrown.
The conversion is directly performed during JSON deserialisation and respects all Newtonsoft.Json attributes
and serialisation settings.
|
Constructors
Fields
Properties
Name |
Description |
Default
|
A JSON-RPC response object that indicates success but has a default result value (null for a
class result type) and the Null JSON-RPC ID.
|
Error
|
Set to the JsonRpcError instance if an error occured during the JSON-RPC request. If the
request succeeded, this property is null .
|
ProtocolVersion
|
The JSON-RPC version of the response.
|
Result
|
The arbitrary JSON-RPC result object. May be null . If an error occurred, this property is always
null . To test for an error indication, use the XploRe.Net.JsonRpc.JsonRpcResponse`1.IsError property.
|
Methods
Name |
Description |
ShouldSerializeResult()
|
Controls serialisation of the Result property. The error property is required in the
payload if the response indicates success; the result may be null .
|
See Also