blob: 5a1ac4d83b9ac659a75f2987b08e768636bace6c [file] [log] [blame]
sg481nbd890c52017-08-28 12:11:35 -04001/*******************************************************************************
2 * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
3 *******************************************************************************/
4function http(meth, sURL, sInput, func) {
5 if (sInput != "") {
6 var http;
7 if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
8 http=new XMLHttpRequest();
9 } else {// code for IE6, IE5
10 http=new ActiveXObject('Microsoft.XMLHTTP');
11 }
12
13 http.onreadystatechange=function() {
14 if(http.readyState==4 && http.status == 200) {
15 func(http.responseText)
16 }
17 // Probably want Exception code too.
18 }
19
20 http.open(meth,sURL,false);
21 http.setRequestHeader('Content-Type','text/plain;charset=UTF-8');
22 http.send(sInput);
23 }
24}