Trigger either a URL or an HTML POST/GET from an event?

NickN shared this question 5 years ago
Answered

Is it possible to trigger an HTML POST or GET from a button/event?


In my prototype, I'd like to trigger a REST API from within the prototype. The user would press a button, which would fire off the POST command. The POST simply triggers a server side event (e.g. updating a server side counter). It does not return anything to the prototype app.


If this is not possible, it is possible to trigger loading a URL in a hidden element (i.e. an element that isn't viewable by the user)?

Comments (3)

photo
1

Hi NickN,


You can use images map to trigger any external URL wherever you want. On the following link you will find an example of how to do it.


http://www.justinmind.com/prototyper/...


Now, select your image map zone and add an event action. Select 'On click' and link to. Then, click on External Address and write the URL that you want to use. I add you an image of how to do it.


4bf5a1873b12780f29412029fd061650


I hope it helps you.

photo
1

But if I enter a URL, won't that open a web view? Since I'm trying to trigger a REST API call, I really don't want the link to open a new window if possible (or at least not one that's visible).

photo
1

Hi NickN,


You can try to use a hidden URL Widget and show it by events. You will find the URL widget on the widget menu, as you can see on the following image.


8145267e4acad59965bab0b0e938d52b


I hope it helps you