Hi Milinda, Thanks for the reply. Yes, I too noticed that. I think we better get this fix right? I'm not sure whom to inform. :) Anyway my actual requirement is to post() a json string with an array to esb and get the response. Here is the code I used. But it throws an exception. Any idea where I did wrong? Help will be appreciate.
<% var url = 'http://localhost:8280/'; var result = post(url, 'Jaggery HTTP POST', {'"newbies" : [{"name":"Dinesh"}, {"name":"Dilan"}, {"name":"Jerad"}]'}, 'application/json'); print(result.data); %> Thanks, Jerad On Thu, Aug 28, 2014 at 4:12 PM, Milinda Perera <[email protected]> wrote: > Hi, > > Seems 'http://jaggeryjs.org/apidocs/resources/data.jag' resource is not > available. > > Thanks, > Milinda > > > > > On Thu, Aug 28, 2014 at 3:39 PM, Jerad Rutnam <[email protected]> wrote: > >> Hi, >> >> Tried to use Jaggery post() method. And it's not working as expected. >> getting an error on the documentation try out feature. >> >> >> *Sample* >> <% >> var url = 'http://jaggeryjs.org/apidocs/resources/data.jag'; >> var result = post(url, 'Jaggery HTTP POST', { >> "User-Agent" : "Jaggery-XHR", >> "Country" : "LK" >> }, 'json'); >> print(result.data); >> %> >> >> *On the local jaggery server* >> *com.google.gson.JsonSyntaxException: >> com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 >> column 27 at line #3* >> >> * On the "jaggeryjs.org <http://jaggeryjs.org>" **website* >> *org.jaggeryjs.scriptengine.exceptions.ScriptException: >> java.net.ConnectException: Connection timed out at line #3* >> >> *http://jaggeryjs.org/documentation.jag?api=post >> <http://jaggeryjs.org/documentation.jag?api=post>* >> >> >> Any feedback appreciate >> >> *Regards,* >> >> *Jerad* >> >> -- >> *Jerad Rutnam | **Software Engineer - UI* >> WSO2, Inc. www.wso2.com >> >> *Email: [email protected] <[email protected]>* >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Milinda Perera > Software Engineer; > WSO2 Inc. http://wso2.com , > Mobile: (+94) 714 115 032 > > -- *Jerad Rutnam | **Software Engineer - UI* WSO2, Inc. www.wso2.com *Email: [email protected] <[email protected]>*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
