Would it be possible to combine the data content and the parameters? Just some ideas:

1) We need a property "parameterMechanism" whith possible values "byUrl" or "byData" which does the following before the request is done:
   byUrl: create URL-encoded parameters and append them to the given URL
   byData: create URL-encoded parameters and send them as data content.

2) If the user defines data content and if parameterMechanism = byData create URL-encoded parameters and append the user data content before the request is done.

And I agree that this should happen in QxPostRequest.

But maybe 2) is not possible at all (concatenating data content and the parameters ).

Feel free to change any property/constant name I used.

What do you think?

Sebastian Werner schrieb:
Probably we could re-add these behaviour, but only, if the user doesn't define the data content? But, as always, I really don't like these implicit changes. Better, I think would be, to handle these things inside a class which extends QxPostRequest (or probably to do it directly there).

Sebastian



Dietrich Streifert schrieb:
@Lothar:

Lothar Kaiser schrieb:
Wow.. quite a fast reply :-)

Well, if the request method is set to 'POST' you could automatically put
the parameters[] into data. But maybe I just didn't get the point with
the difference between data and parameters.
This was the way the deprecated QxXmlHttpLoader class did it: If the method is POST the paramters were sent by req.send().
If the method is GET the parameters are appended to the URL.

There was a method called _applyRequestProperties which formed the URL or the POST data from the parameters.

Then the load method was called like:

    // append the request properties to the request url
    // if the method is of type GET
    if ( method == "GET" )
      url = this._applyRequestProperties(url);

    this.req.open(method, url, true);

    // apply request headers to the request object
    //
    this._applyHeaders();

    // if the request method is POST
    // create a property list and use it as argument to the send
    // method
    var data = null;
    if ( method == "POST" )
      data = this._applyRequestProperties();

    return this.req.send(data);

I just currently have not time to contribute a patch. Sorry.


I'm gonna try out my code with setData().

Thanks,

Lothar




Yes, this is the way qooxdoo's implementation works currently. Parameters will always be attached to the URL. If you want to submit "data" please use setData method for your request object.

What would be a better behaviour in your opinion? Patches are welcome!

Sebastian





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to