viezel / napp.alloy.adapter.restapi

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

How to provide $_GET url params or $_POST variables #28

Closed tjstalcup closed 10 years ago

tjstalcup commented 10 years ago

I'd like to be able to provide a specific parameter to the URL, can I change the URL on the fly?

viezel commented 10 years ago

you can either do:

collection.fetch({
   url:"https://newurl.com/something"
});

or use the urlparams:

collection.fetch({
   urlparams: {
      hello:"you" //will result in yoururl.com/list?hello=you
   }
});