irajsb
April 14, 2020, 7:09am
1
Hey !
I was working on very simple a open-source go plugin that allows ue4 users be able to use nakama matchmaker alongside default game netcode ,and its almost done but problem is default sending json using default http client leads to this error
and strange part is it works fine when request is sent by curl
unreal request :
Curl request:
p.s : parsing error is not happening in my plugin code scope its happening before it gets called . i tried to log before parse and no results .
Which default http client do you use?
irajsb
April 14, 2020, 3:16pm
3
Unreal Native http Client.
Try to add unwrap=1
, example:
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\\\"}\""; // t…
irajsb
April 14, 2020, 4:50pm
5
Dimon4eg:
unwrap=1
what does this unwarp do? now it succeeds but its not having same behavior as expected. how should i change my code to match this?
if unwrap doesn’t work for you then try
var json = "\"{\\\"Val\\\": \\\"a\\\"}\""; // this is unwrapped to {\"Val\": \"a\"} in go`