Unreal Engine 4 – VaRest Storing Response in Variables (Response Code, Response Body)

VaRest one of the most popular plugins for blueprint REST api calling does allow you to also capture the response that comes back.

My issues were that whenever I tried to get the response code or the response body it wouldn’t pull the data (Response kept coming back as -1). Long story short, this is because I never used any event bindings, so effectively as the screenshot shows below, this will only run when the request is complete, before I was trying to store the data before the response even came back. Easy mistakes like this cost time!

Be aware, there’s no checking for fails in this, my view on this is, if the game login api is down, the game won’t launch anyway through other health checks!

 

 

Hope this blueprint helps you! My API is responding in JSON, I recommend your API do the same.