Created
February 5, 2016 15:02
-
-
Save vgrem/9bb29f364f7f2583ff63 to your computer and use it in GitHub Desktop.
This file contains 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
function executeJson(url,method,headers,payload) | |
{ | |
headers = headers || {}; | |
method = method || 'GET'; | |
headers["Accept"] = "application/json;odata=verbose"; | |
var ajaxOptions = | |
{ | |
url: url, | |
type: method, | |
contentType: "application/json;odata=verbose", | |
headers: headers | |
}; | |
if(payload) { | |
ajaxOptions.data = JSON.stringify(payload); | |
} | |
return $.ajax(ajaxOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment