application / x-www-form-urlencoded
Control names and values are escaped. Space characters are replaced with +', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by% HH ', a percent sign, and two hexadecimal digits representing the ASCII character code. Line breaks are represented as pairs of "CR LF" (ie %0D%0A').
The control names/values are listed in the order they appear in the document. The name is separated from the value by= ', and name / value pairs are separated by "&".
JSON.
JSON :
encodeURIComponent (propertyKey) + "=" + encodeURIComponent (propertyValue) .
.
var str = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
str.push(encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]))
console.log(key + " -> " + obj[key]);
}
}
return str.join("&");