Last active
September 19, 2015 18:28
-
-
Save sgaurav/5ef69acae8bccbb74bf8 to your computer and use it in GitHub Desktop.
Serialize JSON, credits http://blog.gospodarets.com/fetch_in_action/
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 serialize(data) { | |
return Object.keys(data).map(function (keyName) { | |
return encodeURIComponent(keyName) + '=' + encodeURIComponent(data[keyName]) | |
}).join('&'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment