Monday, 15 July 2013

Grails passing a list via rest post call -



Grails passing a list via rest post call -

i'm running problem trying grails pass list in post call. i'm using jaxrs plugin , trying pass simple list of integers in query parameter. post phone call looks executing correctly. however, on receiving side, first value of list comes through. signature post method below:

@post metaattributedescriptor post(@queryparam('keyname')string keyname, @queryparam('value')string value, @queryparam('metaattributeid')string metaattributeid)

when phone call query parameter value set [1,2,3,4,5], on receiving side, value set 1. there i'm missing far passing list via rest post call?

edit---

so client side looks this:

def list = [1,2,3,4,5] rest.post([path:'/path_to_service', queryparams: [keyname: 'key', value: list, metaattributeid: 'asdf8asdf7']])

while server side looks this:

@post metaattributedescriptor post(@queryparam('keyname')string keyname, @queryparam('value')string value, @queryparam('metaattributeid')string metaattributeid) println value

that outputs '1' itself. can't figure out why i'm losing rest of list.

grails post jax-rs

No comments:

Post a Comment