John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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]

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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

Return to “Issues”