I wonder it is nakama-dotnet’s issue.
In ApiClient.gen.cs
RpcFunc2Async() send parameter as GET.
But I couldn’t find the code reading payload parameter from query in go code.
Now I found a workaround of this issue by using HttpClient directly.
The payload parameter is unwrapped in go code. So need to enclose in parentheses.
I think adding “unwrap” parameter is useful in this case.
But I don’t know this is correct way…
Like this.
var json = "\"{\\\"Val\\\": \\\"a\\\"}\""; // this is unwrapped to {\"Val\": \"a\"} in go
// var json = "{\"Val\": \"a\"}"; // unwrap version
using (var httpClient = new HttpClient())
{
var content = new StringContent(json, Encoding.UTF8, "application/json");
var accept = new MediaTypeWithQualityHeaderValue("application/json");
httpClient.DefaultRequestHeaders.Accept.Add(accept);
var response = await httpClient.PostAsync("http://127.0.0.1:7350/v2/rpc/test?http_key=key", content);
// var response = await httpClient.PostAsync("http://127.0.0.1:7350/v2/rpc/test?http_key=key&unwrap=1", content); // unwrap version
...
}