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

How to get JSON Parameter from xsjs

$
0
0

Hi All,

 

I'm trying to post my JSON data to xsjs. I'm using Postman. I didn't find to way to get the JSON parameter which I send from POSTMAN.

 

 

Screen Shot 2015-08-16 at 20.11.37.png

 

 

At the begenning I defined my xsjs like below.

 

SENDORDER.xsjs

varjsonparameter = JSON.parse(

  '{'+

      '"products": ['+

                  '{'+

                      '"productName": "Product 1",'+

                      '"price": 4,'+

                      '"quantity": 5'+

                  '},'+

                  '{'+

                      '"productName": "Product 2",'+

                      '"price": 4,'+

                      '"quantity": 5'+

                  '}'+

              '],'+

              '"address": "address",'+

              '"mobile": "mobile"'+

      '}'

  );

 

jsonparameter is working on rest of the code.


I want to try to get JSON from POSTMAN I think it should be something like

 

$.response.contentType = "application/json";

var json = $.request.parameters.get("");

varjsonparameter = JSON.parse(json);

 

But this is not working. json is undefined.

 

My question is how i can get the JSON data to my xsjs from POSTMAN.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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