[aerogear-dev] AeroGear Android & JS API remove operation

Apostolos Emmanouilidis aemmanou at redhat.com
Thu Jun 6 11:32:17 EDT 2013


Hi guys,

While writing some tests for the AeroGear JS API, I came across the
following issue:

The Pipe.remove method of the AeroGear Android API does not require any
data as a response. The callback has Void data. This means that the
corresponding operation on the server/backend side returns an empty
response.

However the AeroGear JS API relies on jQuery AJAX mechanism. When using
the Pipe.remove method, jQuery tries to parse the empty response as JSON
and it fails. I had to hack jQuery and add the following piece of code
in order to use the same backend service for both AeroGear APIs:

parseJSON: function( data ) {
        
        if (!data) {
            return null;
        }

If you know any way to make the AeroGear JS Pipe.remove method to work
when the server side returns an empty response and without hacking the
JQuery, please share it.

Thanks,
Tolis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130606/dfde0a0c/attachment.html 


More information about the aerogear-dev mailing list