Created
August 1, 2012 23:52
-
-
Save skyebook/3231657 to your computer and use it in GitHub Desktop.
Post Body to Javascript Fail
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
function doRequest(request, headers, http_method, request_body, successCallback, failureCallback){ | |
$.ajax({ | |
url: api+request, | |
headers: headers, | |
data:JSON.stringify(request_body), | |
//data:request_body, | |
processData:false, | |
type: http_method, | |
contentType: "application/json", | |
error: function(XMLHttpRequest, textStatus, errorThrown){ | |
failureCallback(textStatus, errorThrown); | |
}, | |
success: function(data){ | |
successCallback(data); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment