Skip to main content

We have a need to create a single URL RESTful service that will give a different response for GET and POST queries. For GET, the service just echoes the data passed, but for POST it must return data from the database in JSON format.

I created an "endpoints.yaml" to create the GET, but have not found any way to create a single URL that answers both GET and POST and treats them differently.

So we might have, for example, a call to the URL:

http://testapi.mbs.net.au:7171/APP/subroutine/TESTSUB?responsecode

This would be expected to simply return the string "responsecode" as specified in the URL. However, if data is POSTed to the same URL (minus the "?responsecode" part), then JSON containing database information would be returned.

I've tried various things in endpoints.yaml but have had no success. Can the above be accomplished in MVIS and, if "yes", how would we go about doing it?



------------------------------
Martin Shields
Senior Technical Consultant
Meier Business Systems PTY LTD
Carnegie VIC AU
------------------------------