Skip to content

Instantly share code, notes, and snippets.

@triple-j
Created April 13, 2017 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triple-j/2de8670ece2dd67b4315927ce10080d1 to your computer and use it in GitHub Desktop.
Save triple-j/2de8670ece2dd67b4315927ce10080d1 to your computer and use it in GitHub Desktop.
FormData To QueryString
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