supreeths84
asked on
XMLHttpRequest Equivalent in C#
I have to create a simple winform which will take in the URL and the input request XML as a parameter and once the user hits the Submit button, the response has to be submitted in a text box. I implemented the same in a .html file and the sequence of operations after the Submit button is hit is shown below:
document.forms["testForm"] .resultXML .value = 'Please Wait....'
var xmlhttp = new XMLHttpRequest()
xmlhttp.open("POST", document.forms["testForm"] .uri.value ,true);
xmlhttp.setRequestHeader(" Man", "POST " + document.forms["testForm"] .uri.value + "HTTP/1.1")
xmlhttp.setRequestHeader(" MessageTyp e", "CALL")
xmlhttp.setRequestHeader(" Content-Ty pe", "text/xml")
xmlhttp.send(document.form s["testFor m"].reques tXML.value )
xmlhttp.onreadystatechange = function() {
document.forms["testForm"] .resultXML .value = xmlhttp.responseText
}
}
Sample code in C# will be helpful to do the above operations.
document.forms["testForm"]
var xmlhttp = new XMLHttpRequest()
xmlhttp.open("POST", document.forms["testForm"]
xmlhttp.setRequestHeader("
xmlhttp.setRequestHeader("
xmlhttp.setRequestHeader("
xmlhttp.send(document.form
xmlhttp.onreadystatechange
document.forms["testForm"]
}
}
Sample code in C# will be helpful to do the above operations.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER