<commit_before>defineModule("Win8JSNetworking", function (require, exports) {
	exports.kickOff = function() {
		var kirinHelper;
		var native = {
			downloadString_: function downloadString_(params) {
				var method = params.method;
				var url = params.url;
				var headers = params.headers;
				var payload = params.payload;
				var onError = params.onError;
				var postData = params.postData;
				
				var xhr = new XMLHttpRequest();
				xhr.open(method, url, true);
				for (var header in headers) {
					if (headers.hasOwnProperty(header)) {
						xhr.setRequestHeader(header, headers[header]);
					}
				}

				xhr.onreadystatechange = function() {
					console.log("onreadystatechange: " + xhr.readyState + ", " + xhr.status);
					if (xhr.readyState === 4) {
						if (xhr.status === 200) {
							kirinHelper.executeCallback(payload, [encodeURIComponent(xhr.responseText)]);
						} else {
						    kirinHelper.executeCallback(onError);
						}
					}
				};
				xhr.send(postData);
			}
		};

		var kirin = require('Win8JSKirin');
		kirinHelper = kirin.bindModule(native, "Networking", false);
		kirinHelper.onLoad();
	};
});<commit_msg>new style networking for W8JS<commit_after>defineModule("Win8JSNetworking", function (require, exports) {
	exports.kickOff = function() {
		var native = {
			retrieve______: function(connId, method, url, postData, headerKeys, headerVals) {
				var xhr = new XMLHttpRequest();
				xhr.open(method, url, true);
				for (var i=0; i<headerKeys.length; i++) {
					xhr.setRequestHeader(headerKeys[i], headerVals[i]);
				}
				
				xhr.onreadystatechange = function() {
					console.log("onreadystatechange: " + xhr.readyState + ", " + xhr.status + ", " + xhr.getAllResponseHeaders());
					if (xhr.readyState === 4) {
						if (xhr.status === 0) {
							module.onError(connId);
						} else {
							module.payload(connId, xhr.status, xhr.responseText, [], []);
						}
					}
				};
				xhr.send(postData);
			}
		};
		var module = require('NetworkingServiceBinding');
        module.onLoad('NetworkingService', native)
	}
});
{'fraction_non_alphanumeric': 0.1446480231436837, 'fraction_numerical': 0.005303760848601736, 'mean_word_length': 3.200404858299595, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '685615', 'n_tokens_mistral': 873, 'n_tokens_neox': 683, 'n_words': 127}