Page 1 of 1

How does a json Post message (with Array) look like when sending out from Appery?

Posted: Fri Jul 19, 2013 4:34 am
by John Herdean

Hi,

I was wondering if i could get to see an example how a Post json message (x-www-form-urlencoded) would look like that has these elements (with an array):

userid: value
name: value
[ array of:

item name: value]


How does a json Post message (with Array) look like when sending out from Appery?

Posted: Fri Jul 19, 2013 7:38 am
by Maryna Brodina

Hello! If you use x-www-form-urlencoded then all data transmitted as url encoded string. To transmit an object you need to create request parameter (call it items for example) and save in that parameter data in needed format. For example create JS in mapping and add codereturn '{"i1": "v1","i2": "v2"}';/code
You can pass any data (not necessary to pass correct JSON) . For example codereturn '["i1": "v1","i2": "v2"]';/code