Hi Deech,
by headers I assume you mean the request body?
With qooxdoo 1.6, and if your server expects JSON, you can set the Content-Type
of the request’s body to "application/json" and provide the data as part of the
parameters hash. Parameters with placeholders associated end up in the URL, the
rest goes to the body and is encoded as JSON.
If you are on master, we've just recently changed this behavior. For the
upcoming version of qooxdoo, a second argument can be provided that ends up
straight in the body.
For example:
res.map("put", "PUT", "/article/{id}");
res.put({id: 1}, '{title: "Awesome title"}'); // JSON
res.put({id: 1}, {title: "Awesome title"}); // URL encoded, automatically
res.put({id: 1}, "title=Awesome%20title"); // URL encoded, manually
For more details, see http://bugzilla.qooxdoo.org/show_bug.cgi?id=5996.
Passing data to the description would only work for data that does not change
per request. If you have static data that should always be merged into the URL
parameters (or data parameters, for master), consider overriding invoke.
Regards
Tristan
Am 03.01.2012 um 23:13 schrieb aditya siram:
> Hi all,
> I would like to attach data to a PUT request of qx.io.rest.Resource. The
> only way I can think to do this is using the configureRequest(...) function
> like :
> r.configureRequest(function(req, action) { ... req.setRequestData(...) ...});
> just before calling qx.io.rest.Resource.put();
>
> It would be more elegant if I could pass in my data into the map that is
> initially used to construct the qx.io.rest.Resource. Is there a way to do
> this?
>
> -deech
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev_______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel