On Thu, Mar 3, 2016 at 1:28 PM, SajithAR Ariyarathna <sajit...@wso2.com>
wrote:

> Hi Iqbal,
>
> As RuwanA mentioned this is not a Jaggery or Java limitation. Simply you
> cannot do this with HTTP. However there is a hack/workaround that you can
> try.
>
> You can stringify your JSON object and send it as a query param.
>
> var payload = {name: "sajith", age: 10};
> var url = "http://example.com?payload="; + encodeURIComponent(stringify
> (payload));
> response.sendRedirect(url);
>
>
> *Disclaimer: Didn't tested.*
>
>
> Nonetheless I must say that sending payloads in redirects is not a good
> programming practice.
>
​yes.. If the payload is huge in size GET will not work.
Try to change the design. first do the POST and ​do what ever processing.
then do the redirect within a callback etc..

> Thanks.
>
> On Thu, Mar 3, 2016 at 8:31 PM, Ruwan Abeykoon <ruw...@wso2.com> wrote:
>
>> Hi Iqbal,
>> If I understand the question correctly, this can not be done. It will be
>> in violation of HTTP spec. [1]
>>
>> [1]
>> http://programmers.stackexchange.com/questions/99894/why-doesnt-http-have-post-redirect
>>
>> Cheers,
>> Ruwan
>>
>> On Thu, Mar 3, 2016 at 6:04 PM, Nipuna Chandradasa <nipu...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> Did you try setting the content to the response as follow?
>>>
>>> response.content = { products : ["Jaggery", "ESB"] };
>>>
>>> I did not try this but this will possibly work.
>>> Please refer the jaggery doc response section for more details.
>>> Regards.
>>>
>>> On Thu, Mar 3, 2016 at 3:45 PM, Irham Iqbal <iq...@wso2.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Is there any way to redirect the page + post the data(json) from a
>>>> plain jaggery file to another jaggery file. I tried with post and
>>>> response.sendRedirect. with post i couldn't redirect the page i only can
>>>> pass the data to that page.  With response.sendRedirect i can redirect the
>>>> page couldn't send the json. Is the a way i can do this ?
>>>>
>>>> Thanks,
>>>> Iqbal
>>>>
>>>> --
>>>> Irham Iqbal
>>>> Software Engineer - Test Automation
>>>> WSO2, Inc.: http://wso2.com
>>>> lean. enterprise. middleware
>>>> phone: +94 777888452
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Nipuna Marcus
>>> *Software Engineer*
>>> WSO2 Inc.
>>> http://wso2.com/ - "lean . enterprise . middleware"
>>> Mobile : +94 (0) 713 667906
>>> nipu...@wso2.com
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>> *Ruwan Abeykoon*
>> *Architect,*
>> *WSO2, Inc. http://wso2.com <http://wso2.com/> *
>> *lean.enterprise.middleware.*
>>
>> email: ruw...@wso2.com
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sajith Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Regards,
UdaraR
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to