Skip to content

Instantly share code, notes, and snippets.

@dhigginbotham
Created April 17, 2014 15:16
Show Gist options
  • Save dhigginbotham/10991147 to your computer and use it in GitHub Desktop.
Save dhigginbotham/10991147 to your computer and use it in GitHub Desktop.
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
$http.defaults.transformRequest.unshift(function (data, headersGetter) {
var key, result = [];
for (key in data) {
if (data.hasOwnProperty(key)) {
result.push(encodeURIComponent(key) + "=" + encodeURIComponent(data[key]));
}
}
return result.join("&");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment