'Using Postman Code in Unreal Engine VARest?

I'm trying to learn how to use VARest in Unreal Engine. But every tutorial uses a single URL and not a JSON input by using "Construct Json Object". My API has multiple functions, and I'm trying to use the one called "readPlayerWallet". When I view the cURL code generated by Postman, I get this:

curl --location --request 
POST '---' \

--header 'Authorization: ---

--header 'Content-Type: application/json' \

--data-raw '{"query":"query readPlayerWallet ($playerGameId: String!, $network: String) 
{\n    readPlayerWallet (playerGameId: $playerGameId, network: $network) {\n        
wallets {\n            id\n            type\n            publicKey\n            
privateKey\n            createdAt\n            balance\n        }\n        info {\n            
status\n            message\n        }\n    }\n}","variables": 
{"playerGameId":"idtest","network":"---"}}'

And Postman returns a JSON file that ends with

"message":"success"}}}}

So my Unreal blueprint looks like this (Set Text's exec is connected to RestCallback, it just broke while I was taking the screenshot): Blueprint

But the text disappears, and doesn't trigger isNull, so I guess it's just empty. Why? How do I solve this?



Solution 1:[1]

Firstly, pull the response node and convert that to string using "to string". This will help you to check if you are getting the complete json file first.

I can't say for sure without looking at the full json file. Have you checked if the message field is directly the child of the response object or if its within an array field or another object field. If by hierarchy it has a parent array or object, you have to call it first...then from that object you have to use "get string field."

Next, check if the json is of the supported format. For example: Nested arrays are not supported by Varest.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rahul