Recently I had to POST a request with both entity data and url parameters; 
instead of passing the URL with query params already specified,
I used both *postBody* and *parameters* fields of the Ajax options for 
coding convenience, but I noticed the latter would never be used, due to
this code in *Ajax.Request.request*:
    if (params && this.method === 'get') {
      this.url += (this.url.include('?') ? '&' : '?') + params;
    }
After those lines, *params* is no more referenced.
In my sources, I replaced the test above with this one:
    if (params && (this.method === 'get' || (this.method === 'post' && 
this.options.postBody))) {
      this.url += (this.url.include('?') ? '&' : '?') + params;
    }
so that, if no postBody is provided, parameters will be posted; if both are 
present, both will be sent to server.

I wonder if there's a strong reason to add params only to GET requests or 
my patch is acceptable.

Cheers

Ubik

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/prototype-scriptaculous/-/OHe7QDbUWKcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to