[Plugin] Http/s REST, blueprintable JSON and Parse REST API manager at once (VaRest)

Damien try to use curly braces instead of regular braces, in the past I found that there is a limitation of the Unreal JSON parser (which VaRest uses) that needs the whole JSON string to be sorrounded by curly braces (even if the original JSON string was JSON correct). Try to answer in this way:


{"data":{"QUANT":"1"}]}

Also, you may have to change the GetObjectArrayField block for a GetArrayField, but I am not sure about this.

You’re using bad json format. It should be {} instead of ] in map.

Hi SuperRey, thank for your answer I going try and post here if works or not.

Hi , thanks for your answer I go make this change and post here if works or not.

Hi and SuperRey

After read and implement both ideas I put the system works fine. Thanks both!!! Here is what changed in my code, both BP and in PHP.

&stc=1

PHP

public static function efetuarLogin($username, $pass)
    {
        require_once 'MySQLDC.php';
            
        $query = "CALL SP_LoginUser('$username', '$pass');";
            
        $mysql = new MySQLDC();
            
        $result = $mysql->execSPForDataSet($query);
            
        $JSON = json_encode ( $result );
    
        if($JSON=="null"){
            $JSON="{}";
        }
    
        return '{"data":' . $JSON . '}';
    }

Hello guys,
Can i call this plugin functions from my C++ classes ? how ?

Add the following code to your Project.Build.cs:


PrivateDependencyModuleNames.AddRange(new string] { "VaRestPlugin" });
PrivateIncludePathModuleNames.AddRange(new string] { "VaRestPlugin" });

Then add the appropriate headers from VaRest like this:


#include "Classes/Json/VaRestJsonValue.h"
#include "Classes/Json/VaRestJsonObject.h"

You may also need to modify the UVaRestJsonValue class definition to look like this:


class VARESTPLUGIN_API UVaRestJsonValue : public UObject

instead of:


class UVaRestJsonValue : public UObject

I think that is all :slight_smile:

1 Like

Just wanted to say that your awesome plugin was forked and included inside another MIT plugin: socket.io client plugin. Thanks for making an amazing base to provide native values, struct, and socket.io raw data conversion to json in blueprints!

Greetings! I just wanted to check how compability is for 4.14.
Cheers!

Plugin works well.
Wanted to know how to access array of objects using blueprints

Has anyone gotten this plugin to work with HTML5 packaging? If I do a blank project without the VARest plugin it builds to HTML5 fine, but if all I do is do the exact same blank project with VARest, it fails to build. Any ideas?

Hi, I am new to REST and JSON, so could anyone explain how I use VARest to encode a screenshot (could be a .png or .jpg file from the harddrive or a Texture2D object within Unreal) and send it to a webserver, I only need to know the Unreal side of things since I have the server ready.
Thanks in advance.

Hi, how can I set timeout of latent “Apply URL” node?

Hi
I am trying to make a login system for my game. I am trying to learn how to use this plugin but I made only mistakes.
How can i found a tutorial whitch starts from 0 and step by step until blueprint creation? I found only two video tutorial whitch starts with an already made example project. I need to create blueprint from 0 and i have not found any documentation about this plugin.
Thank u.

Looping the url

I was wanting to loop the url that i was getting until i leave the object. Is there anyway to do this?

Super!! It is what a I needed for communicating with other systems :d

To create a login system for your game with VARest, I recommend checking out the MMO Starter Kit, as this uses VARest and has a login system built-in.

On a separate note, has anyone gotten HTML5 packaging to work with VARest? The VARest plugin seems to make HTML5 packaging fail.

I wish someone could come up with a VAREST → NodeJS → MongoDB all ready to go… Super fast… Maybe I’ll learn this stuff. Great plugin!

teak

Header problem. Does anyone know why I get

{
“args”: {},
“headers”: {
“Accept”: “/”,

instead of

{
“args”: {},
“headers”: {
“A”: “a”,
“Accept”: “/”,

Hello, is how can i install this plugin on UE4 but built on Fedora ?
I can’t find a solution and i need it for a school team project…