code: function toQuery(json, noEncode) {
      var errorMsg = 'You should not be converting nested objects as they wont encode properly. Try making it a string first.';
      var result = [];
      for (var key in json) {
        if (Object.prototype.toString.call(json[key]) === '[object Object]') {
          throw new Error(errorMsg);
        }
        if (noEncode) {
          result.push(key + '=' + json[key]);
        } else {
          result.push(encodeURIComponent(key) + '=' + encodeURIComponent(json[key]));
        }
      }
      return result.join('&');
    }
docs: Convert an object to a string, not the same as JSON.stringify, converts to POST format, ex: key=value&foo=bar
  @param {object} json - A json object to be flattened into a string