Query parameter in rpc call

Hello, I am trying to call RPC function with query parameter like this:

socket.rpc("user?test=true")

But I am getting an error that –

{code: 6, message: ‘RPC function not found’}

My question is: is it possible to call the RPC method and pass the query parameter? If yes then how?

Versions: Nakama v3.16 | using Golang in docker | JS/Unity client libraries.

Hello @gbarnovi, RPC functions are typically called with a payload string, which can be a JSON string that you can parse in your RPC function. RPC functions do not natively support query parameters like a REST API would. You would have to do something like this:

socket.rpc("user", payload);

You can see an example here.