02-14-2018 01:24 AM - edited 02-14-2018 01:25 AM
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
02-15-2018 09:05 AM
Coincidentally I just came looking for this exact question/answer myself today. I'll be keeping an eye on this thread.
02-16-2018 11:30 AM
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.