enyojs/enyo — pull request #171 by nicolas-rempulski (2012-11-13 12:42:46+00:00)
Title: Query string not build properly on Ajax Request (apart from GET method)

Hi,

enyo.Ajax documentation states :

go: function(inParams)
Sends the ajax request with parameters inParams.

This is partially true as inParams, when a JSON Object, is only added to the query string if the method used is GET. Here is a jsFiddle demonstrating this :

http://jsfiddle.net/SqeLM/
(sent urls can be see in the console logs)

If the query string is hardcoded in the url, it is correctly parsed and used.

This bug is caused by the extraction method used for GET methods in request (which go call):

```javascript
var body = enyo.isString(inParams) ? inParams : enyo.Ajax.objectToQuery(inParams);
```

inParams is treated as the request body no matter what and then, if the method GET is used, transfered from the body to the query string.

But if another method(POST, DELETE, ...) is used, the payload provided by the user erase inParams inside the body and inParams is lost.

I provide a quick fix which always add inParams to the query string.
Other options are :
* to update the doc to reflect the current behavior (wrong imo)
* use a function similar to buildUrl in Jsonp to build the url