Created
May 29, 2015 11:03
-
-
Save sihugh/e7d9440c87fa02c0d8df to your computer and use it in GitHub Desktop.
Stringify Before POSTing
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
var data = { | |
name: "dave", | |
age: 35, | |
height: 188}; | |
var submitData = JSON.stringify(data); | |
$.ajax({ | |
headers: { "X-RequestDigest": formDigestValue }, | |
url: url, | |
method: "POST", | |
contentType: "application/json", | |
data: submitData, | |
success: success, | |
error: error | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment