Hi all

I've run into this peculiar situation, which I'd like to ask you help for:

I'm trying to send JSON to a Django server using the qx.io.remote.Request
object, via the POST method, like so:

          var jsonset='{"mykey":["value1"]}';
          var req = new qx.io.remote.Request(url, "POST",
"application/json");
          req.setData(jsonset);
          req.send()

where req.getData correctly reports that the data is

          {"mykey":["value1"]}

however, the server reports that POST contains

          <QueryDict: {u'{"mykey":["value1"]}': [u'']}>

essentially, the whole json text has been used as a key and the value is an
empty string.
The exact same things happen if jsonset is an object that is parsed to json
through qx.util.Serializer.toJson



Now, on the contratry, if I use

          req.setParameter("mykey", "value1", true)

the server gets the correct POST data, i.e.

         <QueryDict: {u'questions': [u'all']}>


Is there an explanation for this difference in behaviour? What would be the
correct way to send a JSON text through qx.io.remote.Request.setData ?

thanks for your time
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to