First Commit - Source Code from Reply
This commit is contained in:
84
dbcmnpsrc/FE/mnpdev/sim/testHeaderDBCGO.html
Normal file
84
dbcmnpsrc/FE/mnpdev/sim/testHeaderDBCGO.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
var xmlhttp;
|
||||
|
||||
function sendRequest() {
|
||||
xmlhttp=null
|
||||
if (window.XMLHttpRequest) {
|
||||
// code for Mozilla, etc.
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else if (window.ActiveXObject) {
|
||||
// code for IE
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
|
||||
if (xmlhttp != null) {
|
||||
alert(document.getElementById('url').value);
|
||||
u = document.getElementById('url').value;
|
||||
xmlhttp.onreadystatechange = state_Change;
|
||||
xmlhttp.open("GET", u, true);
|
||||
|
||||
xmlhttp.setRequestHeader(document.getElementById('hp1n').value, document.getElementById('hp1v').value);
|
||||
xmlhttp.setRequestHeader(document.getElementById('hp2n').value, document.getElementById('hp2v').value);
|
||||
xmlhttp.send();
|
||||
} else {
|
||||
alert("Your browser does not support XMLHTTP.");
|
||||
}
|
||||
}
|
||||
|
||||
function state_Change() {
|
||||
// if xmlhttp shows "loaded"
|
||||
if (xmlhttp.readyState==4) {
|
||||
// if "OK"
|
||||
if (xmlhttp.status==200) {
|
||||
alert("XML data OK");
|
||||
document.getElementById('status').innerHTML=xmlhttp.status;
|
||||
document.getElementById('statustext').innerHTML=xmlhttp.statusText;
|
||||
document.getElementById('response').innerHTML=xmlhttp.responseText;
|
||||
w=window.open("https://10.174.28.24:7162/dbcgo/getClientInfo.do","resp");
|
||||
w.document.write(xmlhttp.responseText);
|
||||
} else {
|
||||
alert("Problem retrieving XML data:" + xmlhttp.status + " - " + xmlhttp.statusText);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<TABLE align='center'>
|
||||
<TR>
|
||||
<TD colspan="2" align="center"><H3>Send HTTP(S) header parameter to the URL and if OK open a new window with the Response</H3></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD colspan="2" align="center"><B>URL:</B><input type="text" id="url" name="url" value="https://10.174.28.24:7162/dbcgo" size="80"/></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><B>Header param 1</B> name:<input type="text" id="hp1n" name="hp1n" value="username"/></TD>
|
||||
<TD>value:<input type="text" id="hp1v" name="hp1v" value="GG"/></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><B>Header param 2</B> name:<input type="text" id="hp2n" name="hp2n" value="profilo"/></TD>
|
||||
<TD>value:<input type="text" id="hp2v" name="hp2v" value="GG"/></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD colspan="2" align="center">
|
||||
<input type='button' value='SUBMIT' onclick='javascript:sendRequest();'/>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<p><b>status:</b>
|
||||
<span id="status"></span>
|
||||
</p>
|
||||
|
||||
<p><b>status text:</b>
|
||||
<span id="statustext"></span>
|
||||
</p>
|
||||
|
||||
<p><b>response:</b>
|
||||
<br><span id="response"></span>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user