Created
April 13, 2017 16:27
-
-
Save triple-j/2de8670ece2dd67b4315927ce10080d1 to your computer and use it in GitHub Desktop.
FormData To QueryString
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 formDataToQueryString(formData) { | |
var queryParams = []; | |
for(var pair of formData.entries()) { | |
queryParams.push(encodeURIComponent(pair[0]) + "=" + encodeURIComponent(pair[1])); | |
} | |
return queryParams.join('&'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment