viezel / napp.alloy.adapter.restapi

RestAPI Sync Adapter for Titanium Alloy Framework
197 stars 102 forks source link

When encoding, object value should be stringified #79

Closed yomybaby closed 1 year ago

yomybaby commented 8 years ago

If

col.fetch({
    data : { filter : {what : "value" } }
});

url should be ?filter={"what":"value"} But adapter make ?filter={<br/> what = value; }

Look below result

Ti.Network.decodeURIComponent(Ti.Network.encodeURIComponent({what:"value"}));
// {<br/> what = value; }
Ti.Network.decodeURIComponent(Ti.Network.encodeURIComponent(JSON.stringify({what:"value"})));
// {"what":"value"}

So if data value is object, it should be stringified before encoding.