signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

Add Query String Feature ?foo=bar #1

Open signalpoint opened 10 years ago

signalpoint commented 10 years ago

It sure would be nice to be able to pass along a query string that would be appended to the URL path of the Service call.

my_nearest_venues_retrieve({
  data: 'foo=bar'
});

function my_nearest_venues_retrieve(options) {
  try {
    options.method = 'GET';
    options.path = 'nearest_venues/retrieve';
    options.service = 'nearest_venues';
    options.resource = 'retrieve';
    Drupal.services.call(options);
  }
  catch (error) { console.log('my_nearest_venues_retrieve - ' + error); }
}

Expand the Services API to recognize GET requests and data strings that should be appended to the URL path.