Hi Gian Marco,
On Thursday 21 July 2011 12:06:25 Gian Marco Gherardi wrote:
> 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.
For your information: The content type "application/json" is set automatically
when you set method to "POST".
So what should be send over the wire? It has to be serialized into a string
for the native Xhr object - even if you set JSON as data in the high level
implementation.
Feel free to open an enhancement issue if I misunderstood / overlooked
something here. Maybe there is an usecase we missed and that would be good to
know.
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