function urlEncode(object) {
    return Object.keys(object)
        .map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); })
        .join('&');
}
Encodes given object into url-friendly format

@param object An object that contains serializable values
@returns string Encoded