Re: [qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Le Tuesday 03 March 2015, Daniel a écrit : > I see. Looking at the implementation, it should be fairly easy to > support parameters in the longPoll method. It uses a single invoke() > call which would take the parameters and then repeated calls to > refresh() which uses the parameters from the ori

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Daniel Wagner
On 03.03.2015 16:04, Frédéric wrote: > Le 03/03/2015, Daniel a écrit : > >> I'm not really a REST expert, but isn't that something you'd configure >> in your resource description? Something like >> >> var description = { >> "put": { method: "PUT", url: "/eib/new/{ts}"}, >> }; >> >> resource.put(

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Le 03/03/2015, Daniel a écrit : > I'm not really a REST expert, but isn't that something you'd configure > in your resource description? Something like > > var description = { > "put": { method: "PUT", url: "/eib/new/{ts}"}, > }; > > resource.put({ts: something}, data); Yes, but it is not pos

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Daniel Wagner
On 03.03.2015 14:58, Frédéric wrote: > Le 03/03/2015, Daniel a écrit : > >> I can't test it right now, but configureRequest should do it: >> >> res.configureRequest(function(req, action, params, data) { >> req.setRequestData("foo=bar"); >> }); > > I made some tests, and I see 2 problems: > >

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Le 03/03/2015, Daniel a écrit : > I can't test it right now, but configureRequest should do it: > > res.configureRequest(function(req, action, params, data) { > req.setRequestData("foo=bar"); > }); I made some tests, and I see 2 problems: - params are not passed as REST url. For example, I ha

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Le 03/03/2015, Daniel a écrit : > By timestamp do you mean a response header? You can get those from the > Rest event: > > resource.addListenerOnce("success", function(ev) { > ev.getRequest().getResponseHeader("Last-Modified"); > }); > > http://demo.qooxdoo.org/current/apiviewer/#qx.event.type

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Daniel Wagner
I can't test it right now, but configureRequest should do it: res.configureRequest(function(req, action, params, data) { req.setRequestData("foo=bar"); }); On 03.03.2015 12:45, Frédéric wrote: > Another question about Rest: how can I send params with a 'long poll' > request ? > --

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Daniel Wagner
By timestamp do you mean a response header? You can get those from the Rest event: resource.addListenerOnce("success", function(ev) { ev.getRequest().getResponseHeader("Last-Modified"); }); http://demo.qooxdoo.org/current/apiviewer/#qx.event.type.Rest Regards, Daniel On 03.03.2015 12:15, Fréd

Re: [qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Another question about Rest: how can I send params with a 'long poll' request ? -- Frédéric -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with

[qooxdoo-devel] Rest

2015-03-03 Thread Frédéric
Hi! Is there a way to retreive the timestamp sent by the serveur in its response when using Rest com., through qx.io.rest.Resource? -- Frédéric -- Dive into the World of Parallel Programming The Go Parallel Website,

Re: [qooxdoo-devel] REST resource

2013-07-23 Thread Daniel Wagner
Hi Adrian, there is currently no way to exclude query parameters without values from the request URL. The URI RFC[1] doesn't require a value for each key, so it could be argued that your backend must be able to deal with these requests. One thing you could do is define separate resources: var

[qooxdoo-devel] REST resource

2013-07-21 Thread Adrian
Hi, J have one simple question about REST resource. I have defined resource with description: *{"search" : {method : "GET", url : "???"}}* My server side resource is defined to handle request: *../meetings?summary=&dateFrom=&dateTo=* How to define url param in the description to make proper ca

Re: [qooxdoo-devel] Rest and cross domain

2013-07-11 Thread Pau Ruŀlan Ferragut
On Thu, Jul 11, 2013 at 03:56:22PM +0200, Richard Sternagel wrote: >Thanks, you spotted a blind spot (i.e. bug) here, which I fixed now. :) Thanks to you for your time! >So this works now with the current master (not yet in the devel playground): Great. >Hope that helps. Yes, it really helped

Re: [qooxdoo-devel] Rest and cross domain

2013-07-11 Thread Richard Sternagel
Hi, > The problem is not the qx.io.request.Json but the fact we are trying > to use the qx.io.rest.Resource wrapper: > http://demo.qooxdoo.org/devel/apiviewer/#qx.io.rest.Resource okay, I just wanted to check this first before digging deeper. Thanks, you spotted a blind spot (i.e. bug) here, whi

Re: [qooxdoo-devel] Rest and cross domain

2013-07-10 Thread Pau Ruŀlan Ferragut
On Wed, Jul 10, 2013 at 02:29:31PM +0200, Richard Sternagel wrote: >does this playground sample work on it's own with your web service >URL? The problem is not the qx.io.request.Json but the fact we are trying to use the qx.io.rest.Resource wrapper: http://demo.qooxdoo.org/devel/apiviewer/#qx.io.

Re: [qooxdoo-devel] Rest and cross domain

2013-07-10 Thread Richard Sternagel
Hi again, does this playground sample work on it's own with your web service URL? http://tinyurl.com/nqxo9dh (It's just the code copied from here with "console.log()": http://demo.qooxdoo.org/devel/apiviewer/#qx.io.request.Jsonp) Are you able to share the web service URL so that I can test with

Re: [qooxdoo-devel] Rest and cross domain

2013-07-10 Thread Pau Ruŀlan Ferragut
On Tue, Jul 09, 2013 at 05:47:33PM +0200, thron7 wrote: >Can you post a snippet of code, to illustrate how you tried to deploy >Jsonp?! That idea came from the documentation, where it says: http://demo.qooxdoo.org/devel/apiviewer/#qx.io.rest.Resource~_getRequest «May be overriden to change type o

Re: [qooxdoo-devel] Rest and cross domain

2013-07-10 Thread Pau Ruŀlan Ferragut
On Wed, Jul 10, 2013 at 01:38:10PM +0200, Richard Sternagel wrote: >are you in control of the server? Can you add custom headers? No to both questions. >PS: You are using qx.Desktop, aren't you? Yes, qx.Desktop. -- See

Re: [qooxdoo-devel] Rest and cross domain

2013-07-10 Thread Richard Sternagel
Hi, are you in control of the server? Can you add custom headers? If the answer is "yes", then make sure that your server responds with this header (you should not use the wildcard symbol for production only within your development environment [1]): -- Access-Control-Allow-Origin: * --

Re: [qooxdoo-devel] Rest and cross domain

2013-07-09 Thread thron7
Can you post a snippet of code, to illustrate how you tried to deploy Jsonp?! T. On 07/09/2013 03:52 PM, Pau Ruŀlan Ferragut wrote: > How should you use the REST module if the target service is in > another domain? > > The Request object is HXR and does not work. I have tried to > overwrite it w

[qooxdoo-devel] Rest and cross domain

2013-07-09 Thread Pau Ruŀlan Ferragut
How should you use the REST module if the target service is in another domain? The Request object is HXR and does not work. I have tried to overwrite it with a Jsonp request but it did not work. All the examples in the docs and API are in a localhost. http://demo.qooxdoo.org/current/apiviewer/#qx

Re: [qooxdoo-devel] REST CORS

2012-04-17 Thread Simon Walter
Hi Tristan, Thanks for the info. I must have been setting the URL incorrectly last time I tried. Because now it works!. I'm building a custom server with PION, rapidjson, and soci. So I've already set up the HTTP headers. As far as making requests is concerned, would this be a correct way to

Re: [qooxdoo-devel] REST CORS

2012-04-16 Thread Tristan Koch
Hi Simon, rest.Resource uses io.request.Xhr internally, so you can do CORS with rest.Resource. Note you need to configure your server to set appropriate HTTP headers [1]. You can use rest.Resource with io.request.Jsonp by sub classing and overriding _getRequest(). The problem with JSONP, howev

Re: [qooxdoo-devel] REST CORS

2012-04-13 Thread Simon Walter
Thank you Martin. I understand about CORS and browser support. That is always a concern. It looks like qx.io.request.Jsonp does not inherit from qx.io.remote.Request, and so there is no setMethod() method. However, qx.io.request.Xhr has a setMethod() method. I think a setMethod() method for qx

Re: [qooxdoo-devel] REST CORS

2012-04-13 Thread Martin Wittemann
Hello, When having the REST service on another machine, you have to use either JSONP or CORS. I'm not the export in that area but as far as I know, CORS is not supported by all browsers. Nevertheless, I forwarded you mail to the author of our REST and io layer which can give you some more detail

[qooxdoo-devel] REST CORS

2012-04-12 Thread Simon Walter
Hi all, I'm trying to decide on an web service API structure. Ideally I'd like it to be in the REST style. I've played around with qx.io.rest.Resource and it works. However, I cannot see a way to specify a different server. Yes I'd like to be able to have the REST service on a different server

Re: [qooxdoo-devel] REST error handling

2012-03-24 Thread Matthias R .
That's it. Thanks a lot, Tristian! BR, Matthias -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ qooxd

Re: [qooxdoo-devel] REST error handling

2012-03-22 Thread Tristan Koch
Hi, get the request from the event [1], then query "responseText" and "status" properties. Hope this helps! Regards Tristan [1] http://demo.qooxdoo.org/current/apiviewer/#qx.event.type.Rest Am 22.03.2012 um 14:04 schrieb Matthias R.: > Hi, > is there a way to retrieve the error code and/or t

[qooxdoo-devel] REST error handling

2012-03-22 Thread Matthias R .
Hi, is there a way to retrieve the error code and/or the response text of a qx.io.rest.Rest action? In the fired Error event I can see that an error has happened but I can find neither the error code nor the response text. Can anyone give me a hint where to look for error code and/or response text.

Re: [qooxdoo-devel] REST Resource and JSON with custom encoder/decoder

2011-12-16 Thread Tristan Koch
Hi Scott, there is no example that covers everything you mentioned, but you might want to take a look at the Github demo [1] and some code snippets mentioned below. Content type and accept headers of the request can be configured with rest.Resource#configureRequest. The content type of the resp

[qooxdoo-devel] REST Resource and JSON with custom encoder/decoder

2011-12-15 Thread Scott Chapman
I'd like to have a REST resource that handles JSON both for sending and receiving, with the correct Content-Type and Accept headers coming and going. POSTing to the REST url should get back the Location header for the new item as well. Further, I'd like to plug in a custom datetime json encoder