Hi Ruchira,
But the problem is that getContent() method doesn't properly handle int
arrays.

Peace~


On Wed, Oct 30, 2013 at 3:49 PM, Ruchira Wageesha <[email protected]> wrote:

> Hi Chan,
>
> Instead of parse(), use JSON.parse(). It will solve your problem. parse()
> and stringify() methods have been deprecated as ECMAScript 1.5 itself has
> JSON.parse() and JSON.stringify().
>
> /Ruchira
>
>
> On Wed, Oct 30, 2013 at 3:25 PM, Chan <[email protected]> wrote:
>
>> Hi,
>> I am trying to send data via post request and int arrays are being lost
>> somewhere. My payload is  {"ints": [1,2]}  and what I see in the console
>> is {"ints" : [{}, {}]}. I debugged jaggery and figured out that Gson
>> properly passes the int array and sends to the buildObject method
>> (HostObjectUtils L73). Afterwards the ints are encapsulated in a Rhino
>> native array. When we are return the content it is only shown as objects.
>>
>> I tried sending the request as text/plain and performing
>> log.debug(parse(String(request.getContent())));
>>
>> but still the log is  {"ints" : [{}, {}]}
>>
>> Peace~
>>
>> --
>> Chan (Dulitha Wijewantha)
>> Software Engineer - Mobile Development
>> WSO2Mobile
>> Lean.Enterprise.Mobileware
>>  * ~Email       [email protected]*
>> *  ~Mobile     +94712112165*
>> *  ~Website   dulithawijewantha.com
>> *
>> *  ~Blog         blog.dulithawijewantha.com<http://dulichan.github.io/chan/>
>> *
>> *  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
>>
>
>
>
> --
> *Ruchira Wageesha
> **Associate Technical Lead*
> *WSO2 Inc. - lean . enterprise . middleware |  wso2.com*
> *
> email: [email protected],   blog: ruchirawageesha.blogspot.com,   mobile: +94
> 77 5493444*
>



-- 
Chan (Dulitha Wijewantha)
Software Engineer - Mobile Development
WSO2Mobile
Lean.Enterprise.Mobileware
 * ~Email       [email protected]*
*  ~Mobile     +94712112165*
*  ~Website   dulithawijewantha.com
*
*  ~Blog         blog.dulithawijewantha.com<http://dulichan.github.io/chan/>
*
*  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to