advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Partners & Affiliates
advertisement
advertisement
Tip of the Day
Average Rating: 1.5/5 | Rate this item | 4 users have rated this item.
Expertise: All
Language: Web
April 18, 2000
Use XMLHttpRequest Object for Communication With HTTP Servers
The XMLHttpRequest object provides client-side protocol support for communication with HTTP servers. A client computer can use the XMLHttpRequest object (Microsoft.XMLHTTP) to send an HTTP request, to receive the response, and to have the Microsoft XML Document Object Model (XML DOM) parse that response.

This object is integrated with Microsoft's XML to support sending the request body directly from, and parsing the response directly into, the Microsoft XML DOM objects. This object allows us to post XML from a client application to an ASP page.

Here is a client-side JScript code that shows how we can use this object. In this example, we initialize a request with the open method, specifying the HTTP method to use and the URL to connect to. We then use the send method to send the contents of the XML data island to the designated URL.

 
<SCRIPT LANGUAGE="JScript">
function SendXmlOverHttp()
{
    var objXmlHttp;

    objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    objXmlHttp.open("POST", "SampleAspPage.asp", false);
    objXmlHttp.send("<XML><Employee>Deepak Pant</Employee></XML>");
}
</SCRIPT>
Deepak Pant
If you have a hot tip and we publish it, we'll pay you. However, due to accounting overhead we no longer pay $10 for a single tip submission. You must accumulate 10 acceptable tips to receive payment. Be sure to include a clear explanation of what the technique does and why it's useful. If it includes code, limit it to 20 lines if possible. Submit your tip here.
Please rate this item (5=best)
 1  2  3  4  5
advertisement
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About