Hi, thanks for taking time to respond.

> Did you look at the "requestData" property?

Yes i've used it, this is what i've tried:

var req = new qx.io.request.Xhr("/rpc", "POST");
req.setRequestData({ "title": "The title" });
req.send(); // send request data as form encoded, with content type
"application/x-www-form-urlencoded"

var req = new qx.io.request.Xhr("/rpc", "POST");
req.setRequestHeaders({ "Content-Type": "application/json" });
req.setRequestData({ "title": "The title" });
req.send(); // send request data as form encoded, with content type
"application/x-www-form-urlencoded, application/json"

var req = new qx.io.request.Xhr("/rpc", "POST");
req.setRequestHeaders({ "Content-Type": "application/json" });
req.setRequestDataqx.lang.Json.stringify({ "title": "The title" }));
req.send(); // send request data as json encoded, with content type
"application/x-www-form-urlencoded, application/json"

So, none of the example work as i need. I think that, with
qx.io.request in 1.5, is not possible to achieve what i need.

Gian Marco Gherardi
http://gianmarco.gherardi.me



On Thu, Jul 21, 2011 at 11:03 AM, Alexander Steitz
<[email protected]> wrote:
> Hi Gian Marco,
>
> On Thursday 21 July 2011 09:04:17 Gian Marco Gherardi wrote:
>> i'm trying to use qx.io.request.Xhr to call services that accept POST
>> request with JSON encoded body and respond with JSON encoded data.
>> It is like a qx.io.remote.Rpc mechanism, but i'm trying to only rely
>> on the new qx.io.request framework.
>>
>> Seems that qx.io.request.Xhr can handle JSON response, but cannot
>> handle JSON request data, am i missing something?
> Did you look at the "requestData" property?
> ->
> http://demo.qooxdoo.org/current/apiviewer/#qx.io.request.AbstractRequest~requestData
>
> This property is accepting a map as value, so handing in JSON should not be a
> problem here.
>
>> What is in your opinion the best strategy for implementing RPC like
>> comunication in Qx 1.5 for new applications?
>> - Use qx.io.remote.Rpc, even if it's based on the old io stack.
>> - Create a custom implementation of qx.io.request.AbstractRequest
>> - Directly use qx.bom.request.Xhr
> I guess the best would be to ask this question in a separate thread so the
> developers of Rpc layer can respond.
>
> Regards,
>  Alex
>
> ------------------------------------------------------------------------------
> 5 Ways to Improve & Secure Unified Communications
> Unified Communications promises greater efficiencies for business. UC can
> improve internal communications as well as offer faster, more efficient ways
> to interact with customers and streamline customer service. Learn more!
> http://www.accelacomm.com/jaw/sfnl/114/51426253/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>

------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to