Skip to content

Instantly share code, notes, and snippets.

@ntoskrnl
Last active September 30, 2017 19:42
Show Gist options
  • Save ntoskrnl/28bbdf7daaac1ce242ebc2398c1ae76d to your computer and use it in GitHub Desktop.
Save ntoskrnl/28bbdf7daaac1ce242ebc2398c1ae76d to your computer and use it in GitHub Desktop.
An example of inconveniences when using JsonRpcClient
val client: JsonRpcClient = ...
val request = JsonRpcRequest(
id = generateUniqueId(),
method = "myMethod",
params = mapOf(
"param1" to 100,
"param2" to "value",
"param3 to listOf(1, 2, 3)
)
)
val responseType = typeToken<MyResponse>()
val result = client.call<MyResponse>(request, responseType)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment