3 Replies Latest reply on Jun 18, 2018 9:22 AM by rareddy

    Rest Service Post Method - How to pass multiple input parameters?

    cm.kumar

      Hello,

       

      I have a stored procedure defined in VDB, which is enabled to get deployed as rest service (war).

       

      Stored procedure gets 3 input parameters and is defined to use rest method as http'Post'.

       

      I'm trying to test this rest service using PostMan, where I pass the input parameters in Body as form-data. But the input parameters are not getting passed into the stored procedure.

       

      Let me know, what I'm doing wrong.

       

      Post URL - http://serverName:8080/AppConfig_1/Config/scg

       

      Input parameter passed in body,

       

      {

      "userConfig":"test",

      "confId":"10",

      "userId":"testUser"

      }

       

       

      Stored procedure defined in the VDB,

       

      SET NAMESPACE 'http://teiid.org/rest' AS REST;

      CREATE VIRTUAL PROCEDURE SetUserConfig(IN userConfig string, IN confId string, IN userId string)  OPTIONS (UPDATECOUNT 0, "REST:METHOD" 'POST', "REST:URI" 'scg')

      AS

      BEGIN

      DECLARE integer collection_id = 4 ;

       

      INSERT INTO app_user_config(id, config_name, config_value, collection_id, user_id) VALUES (AppConfig.nextval('app_uconfig_id_seq'),confId, userConfig, collection_id, userId);

       

      END