On Tue, Mar 13, 2012 at 05:51, ramiyer <[email protected]> wrote:

> I am using Qooxdoo AJAX to POST the following data
>
>
>    req = new
> qx.io.remote.Request("http://localhost:8080/smartways/vehicle/";, "POST",
> 'application/json');
>      req.setCrossDomain(false);
>      req.setRequestHeader("Accept","application/json");
>      req.setRequestHeader("content-type","application/json");
>      req.setData(
>
> '{"id":2,"type":"Bus","depot":"Indiranagar","simMSISDN":"9959142000","imeiNumber":"I-1234567","gatewayId":"G1","make":"MARUTI","capcity":75,"numberOfDoors":2,"fuelCapacity":100,"fuelEconomy":10,"maxPermittedSpeed":100,"vehicleIdentificatioNumber":"KA-10Z-5428"}');
>
>
> However it seems at backend the media type is set to
> application/x-www-form-urlencoded and I am getting a parse error.
>

It looks like the Iframe transport may be getting selected instead of the
XmlHttp transport that you desire here, but I can't see anything wrong with
your code. I suggest setting a breakpoint at qx.io.remote.Exchange, line
652, which is the beginning of the loop where the appropriate transport is
selected. The first transport in the list should be XmlHttp, and that one
should *handle* all of the *needs* of your request, and be selected. If the
continue statement is hit, that means that some *need* isn't being *handled* by
that transport, and you need to look at the *needs* to determine what
you're setting that isn't available to the XmlHttp transport.

(You are showing your entire request code, right? If you have a
req.setFormField() call someplace in your code, that would cause this
problem.)

Cheers,

Derrell
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to