LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

web-server: POST + GET for one vi

Is it possible to do ONE vi for both GET/POST methods?
I have index.html where the user can click the button. And the web page generates a POST request for the server. The ../get_form page opens.
Also, the user can save a shortcut for the page ../get_form. This will be a GET request (with empty form fields).
So, I need both GET / POST methods for one page.
Is it possible?
Now I made two VIs with the same subVI, but I need to fix url-mapping manually

 

Безымянный.png

0 Kudos
Message 1 of 3
(2,361 Views)

Coincidentally I just came looking for this exact question/answer myself today.  I'll be keeping an eye on this thread.

0 Kudos
Message 2 of 3
(2,324 Views)

You should be able to have GET and POST methods within a single VI. Best practice is to have a single web resource VI for each and then control how and when they're called by a top level VI. That way is more general, if you have a specific function where you want to GET and POST and you always want to do them together you can create a web resource VI with both methods. For more information on why this isn't a recommended option you can research RESTful web services. 

0 Kudos
Message 3 of 3
(2,307 Views)