x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to POST using VaRest

Hi, I'm using this plugin, https://forums.unrealengine.com/showthread.php?13509-Plugin-Http-s-REST-blueprintable-JSON-and-Parse-REST-API-manager-at-once-%28VaRest%29 and this guide for it https://github.com/ufna/VaRest/wiki/Plugin-Usage to try and use GET and POST requests but I'm having a bit of trouble getting it to accomplish anything. This is what I have so far.

alt text

I don't have much experience with Rest so the solution might be much easier than I thought. This is the site I'm trying to POST to http://www.posttestserver.com/ but the only thing I've seem to have got working is opening a webpage with a URL. It's going through the code, I think it's just missing something crucial that tells it to post. Any help would be much appreciated.

Product Version: Not Selected
Tags:
postproblem.png (336.0 kB)
more ▼

asked Jan 16 '15 at 07:11 PM in Blueprint Scripting

avatar image

CBFlood
36 8 15 16

avatar image SlyFly7 Aug 28 '16 at 01:39 AM

Hi, I am looking everywhere and can't find an information of how to break up received Json from a website, and put it into variables inside unreal. I am just receiving the whole Json structure and I am able to print it as a whole, but I want to save parts of it in variables. could anyone help?

Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

alt text

In order to get my post request to work, I had to Set Request Object from my JSON Data Object after I finished setting all the fields for the data. Before I did this, it was just sending null values!

capture.jpg (194.7 kB)
more ▼

answered Apr 08 '17 at 07:37 AM

avatar image

Trandana
52 4 5 10

avatar image Vishal Thakur Apr 24 '18 at 12:55 PM

Trandana - Yes This resolved the issue at my end. It was sending null values. Setting the JsonRequestObj before the processURL does the job. Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Based on your screenshot, there are two things missing (one of which is kind of important).

The important part is: do the "Get Request Object" on your "VA JSONRequest" and use that for your "Set Field".

Other than that, I greatly suggest you Bind "OnRequestComplete" and "OnRequestFail" from the same "VA JSONRequest", otherwise it's going to be a bit tricky to figure out what went wrong (or right ;)) Use the "Get Response Object" from the "VA JSONRequest" in order to see what the server is returning to you.

Hope this helps get you on your way.

more ▼

answered Jan 16 '15 at 11:48 PM

avatar image

Justin.Dooley
2.1k 104 70 160

avatar image CBFlood Jan 17 '15 at 03:24 PM

I've included the Get Request Object now but nothing seems to have changed as far as I can see. I also tried (even before asking this question) to use OnRequestFail and Complete but for some reason when I click on them after right clicking they just don't appear on the graph for some reason.

Also, do I need a VaRestJson Object at all? Is a Request all I need?

avatar image CBFlood Jan 19 '15 at 04:17 PM

Binding doesn't seem to be an option for me at all. I'm trying to do a get method now identical to the way it's done in the link I provided above but where they have BindEvent to OnRequestCopmlete I get nothing. OnRequestComplete exists but like I said, clicking on it does nothing.

avatar image Justin.Dooley Jan 19 '15 at 06:21 PM

Request becomes the object.

Here's a very short and quick example I've set up to demonstrate how I've been using VA Rest.

The Blueprint:

This is how I setup the request

My Test URL is a simple PHP script I've created to deal with the VARequest that is being sent out to my test server. The script itself only goes through the response and spits back the parameter I gave it as a response.

Super simplified PHP script that deals with the request made

When I ran the project, I got the expected "Request completed: Hello_VA_Rest"

varest.png (345.7 kB)
varestphp.png (8.5 kB)
avatar image CBFlood Jan 20 '15 at 04:47 PM

I'm still getting the problem with the On Request Complete or Fail simply not working for me. It just doesn't appear on the graph. I made a video of it. https://www.youtube.com/watch?v=NK5dxmoDYww&feature=youtu.be

avatar image Justin.Dooley Jan 20 '15 at 08:49 PM

Oh, I see now where your problem lies :)

Bringing up the context sensitive menu by right clicking on a blue print will only give you the proper context for the blueprint itself, so all the methods available to it.

What you want is the context menu for the Object itself, in this case VA Rest Request. You need to get the variable (drag it from the hierarchy, to the blueprint and choose get) and then, use it to get its own "On Request Complete" (click and hold on the link for the variable and release on the blueprint, it will pop up a context menu with everything related to VARest, including the events).

This is just basic blueprint communication though, if you're not familiar with it, I greatly suggest going over: Blueprint Communication Usage

I hope this helped you out :)

avatar image CBFlood Jan 21 '15 at 12:52 PM

Yes. I've managed to put it on now thanks. The reason I had Context Sensitive off in the first place is because nothing would show up when it was on and I was normally right clicking. But I have the on success/fail now so hopefully it works. Still weird that just right clicking to get it fails to do anything. I suppose that's because it's not being attached to anything when it's created.

avatar image Justin.Dooley Jan 21 '15 at 04:30 PM

If this issue is done, can you mark it as resolved? :)

avatar image CBFlood Jan 21 '15 at 04:34 PM

Yeah I think it's done. I'm still having some issues, the get is working but the post isn't quite yet. Though I think that's because of the URLs but I'll figure them out on my own. I should be using an online database anyway. They were just tests.

avatar image BlackGolem Aug 25 '16 at 02:33 PM

Great! This is exactly what I was searching for...Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question