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.
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.