Passing the QueryString in the headers of a REST call

I would like to pass the queryString of the current rest call as a parameter in my headers.

Here is an example of code:

    namespace: 'api',
    host: function () {
        return 'https://something/';
        'AUTH': 'I need The QueryString to this REST Call. eg: UserID="12134"&Date="10/15/16"'

Thanks for your help!

Since you require looking at the data you are sending on your request, you might want to look into extending the RESTAdapter and overriding the ajax method. In there, use to extend the Adapter’s headers, eg.

untested code

ajax: function(url, type, options) {
  var data = || {};
  var headers = this.get('headers') || {};
  Ember.merge(headers, data);
  return this._super.apply(this, arguments);

Thanks @neojp. That did it!

Great! I didn’t even test it :slight_smile: