Quantcast
Channel: SCN : Discussion List - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3131

post in XSJS

$
0
0

hi ,

 

I am not able to post any data using POSTMAN. I am getting 403 forbidden error.

I have tried few solution already available in SCN.

I have created a .sqlcc file.

This is my .sqlcc file.

{

 

 

"description":"login"

}

 

this is my ..xsaccess file.

 

{

     "exposed" : true, 

                 

     "authentication" :                                          

            {

               "method": "Form"  

            },

 

     "cache_control" : "must-revalidate",

 

 

     "cors" :                     

            {

             "enabled" : false

            },

                    

     "enable_etags" : false,

 

 

     "force_ssl" : false,

    

     "prevent_xsrf" : true

}

 

this is my post method:

 

var query = 'insert into ' +schemaName+ '.user(userid, name, email) values(?, ?, ?)';

        var stmt = connection.prepareStatement(query);

        stmt.setString(1, user.userId);

        stmt.setString(2, user.name);

        stmt.setString(3, user.email);

       

        stmt.executeQuery();

       

        $.response.status = $.net.http.CREATED;

        $.response.setBody("created");

 

 

thanks & regards ,

Animesh Ghosh


Viewing all articles
Browse latest Browse all 3131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>