Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter to pass on every read() #51

Closed
Disane87 opened this issue Apr 22, 2016 · 1 comment
Closed

Parameter to pass on every read() #51

Disane87 opened this issue Apr 22, 2016 · 1 comment

Comments

@Disane87
Copy link

For my API on the sever I need to pass &transform=1 to get structured data to read.
Is there any convenient way to pass this on every call without changing all calls?

@Disane87
Copy link
Author

Disane87 commented May 9, 2016

Just discovered a solution:

restAjaxOptions = {
          success: function(data, textStatus, jqXHR) {
             console.log('success ' + jqXHR);
             debugger;
          },
          error: function(jqXHR, textStatus, errorThrown) {
             console.log('error ' + jqXHR);
          },
          beforeSend: function(jqXHR, settings){
            settings.url = settings.url + '&param=p1';
            console.log('before send ' + settings.url);
          }
      };
      $.api.add([Endpointname],  {ajax: restAjaxOptions});

@Disane87 Disane87 closed this as completed May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant