views:

146

answers:

2

hi, when creating and sending an http POST request like this...

        var req = new qx.io.remote.Request("/test","POST");
        req.setParameter("pi", "3.1415");
        req.setParameter("color", "red");
        req.setParameter("password", "mySecretPassword");
        req.send();

... paramters are send in the body and in the url. this is a problem because parameters may break when getting bigger, and for security reasons it is not ok for all parameters to show up in logfiles. am i doing something wrong, or is this a bug? my workaround is to concat and uriencode parameters by myself and put them in the body with req.setData(data).

+2  A: 

.setParameter has an optional third argument. If set to true, the parameter for the request will go into the data section instead of the URL; see the API doc.

ThomasH
hi again. i looked in my code and found that i used the third arg before, but it was commented out. i tryed it again with true as "bAsData" arg, but it does not work as expected. the parameters are not send at all. both url and body. the only parameter send is "nocache".
mika26
by the way... i am using qooxdoo 1.0.1 :-)
mika26
Are you doing a cross-domain request? Did you see the note in API doc for .setParameter about that?
ThomasH
no, this is a request to "/test" on the same server as the qooxdoo app.
mika26
Then please open a bug report for this, http://bugzilla.qooxdoo.org/
ThomasH
A: 

Take a look at the documentation at http://demo.qooxdoo.org/current/apiviewer/#qx.io.remote.Request for the setParameter-method.

setParameter(String vId, var vValue, (Boolean | false) bAsData) has an optional third parameter bAsData

If false, add the parameter to the URL. If true then instead the parameters added by calls to this method will be combined into a string added as the request data, as if the entire set of parameters had been pre-build and passed to setData().

So adding an third parameter with the value true to your req.setParameter should do the trick.

dashhunter
unfortunately not working, see comment above.
mika26