Created
July 22, 2016 21:44
-
-
Save uhtred/73568ad7480ed6aa38675b61290a50e9 to your computer and use it in GitHub Desktop.
Jquery prefilter restfull
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxPrefilter(function(options, originalOptions, jqXHR) { | |
if ((options.type === 'post' || options.type === 'put') && options.contentType === 'application/json') { | |
options.data = JSON.stringify(originalOptions.data); | |
} | |
options.url = 'baserUrl' + originalOptions.url + '?gw-app-key=' + window.config.gwAppKey; | |
}), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment