All,
I am wondering how to build a dynamic JSON object in JSL ?
request = New HTTP Request(
url( "http://httpbin.org/post" ),
Method( "POST" ),
JSON( "\[{"username":"bob","address":"12345"}]\" )
); Using the example from the scripting index, if I wantedt to vary the username from bob to say mark and address from 12345 to 12346 and I have 10 such calls, I would prefer building that as a dynamic object outside. I initially ventured down the path of building it as an Associative Array and then using the As JSON Expr() , however, that is resulting in an error. My approach in that case was:
MyAA = Associative Array();
MyAA["username"] = "bob" ;
MyAA["address"] = "12345" ;<BR /><BR />request = New HTTP Request(
url( "http://httpbin.org/post" ),
Method( "POST" ),
JSON( As Json Expr(MyAA))
);
Of course, this is not happening for this example, but the api I am trying to call on. However, when I pass hardcoded JSON as an input, the api call works as expected.

Any help is appreciated.