function Request() {
	const g_keyValues = Array();

	/*
	 * Append a key-value-pair to a request.
	 */
	this.append = function(key, value) {
		const kv = new KeyValuePair(key, value);
		g_keyValues.push(kv);
	};

	/*
	 * Returns the URL encoded data for this request.
	 */
	this.getData = function() {
		const numPairs = g_keyValues.length;
		let s = '';

		/*
		 * Iterate over the key-value pairs.
		 */
		for (let i = 0; i < numPairs; i++) {
			const keyValue = g_keyValues[i];
			const key = keyValue.getKey();
			const keyEncoded = encodeURIComponent(key);
			const value = keyValue.getValue();
			const valueEncoded = encodeURIComponent(value);

			/*
			 * If this is not the first key-value pair, we need a separator.
			 */
			if (i > 0) {
				s += '&';
			}

			s += keyEncoded + '=' + valueEncoded;
		}

		return s;
	};

}
/*
 * A class implementing a JSON request.
 */
A class implementing a JSON request.
A class implementing a JSON request .
function Request() {
	const g_keyValues = Array();
	this.append = function(key, value) {
		const kv = new KeyValuePair(key, value);
		g_keyValues.push(kv);
	};
	this.getData = function() {
		const numPairs = g_keyValues.length;
		let s = '';
		for (let i = 0; i < numPairs; i++) {
			const keyValue = g_keyValues[i];
			const key = keyValue.getKey();
			const keyEncoded = encodeURIComponent(key);
			const value = keyValue.getValue();
			const valueEncoded = encodeURIComponent(value);
			if (i > 0) {
				s += '&';
			}
			s += keyEncoded + '=' + valueEncoded;
		}
		return s;
	};
}
function Request ( ) { const g_keyValues = Array ( ) ; this . append = function ( key , value ) { const kv = new KeyValuePair ( key , value ) ; g_keyValues . push ( kv ) ; } ; this . getData = function ( ) { const numPairs = g_keyValues . length ; let s = '' ; for ( let i = 0 ; i < numPairs ; i ++ ) { const keyValue = g_keyValues [ i ] ; const key = keyValue . getKey ( ) ; const keyEncoded = encodeURIComponent ( key ) ; const value = keyValue . getValue ( ) ; const valueEncoded = encodeURIComponent ( value ) ; if ( i > 0 ) { s += '&' ; } s += keyEncoded + '=' + valueEncoded ; } return s ; } ; }
A class implementing a JSON request.
A class implementing a JSON request .
/*
	 * Append a key-value-pair to a request.
	 */ /*
	 * Returns the URL encoded data for this request.
	 */ /*
		 * Iterate over the key-value pairs.
		 */ /*
			 * If this is not the first key-value pair, we need a separator.
			 */