As you know, access to data from the Internet can be accomplished in several ways. Browsers are a type of Web client that allow you to send requests to a particular Uniform Resource Identifier (URI) and get an answer in a standard format. Browsers are large customers readable web content and will display the results in HTML format allowing you to read the text and view images. Performing more advanced tasks such as removal of a stock price of a Web page can be quite difficult and techniques such as scraping of the page are not trivial to implement. So how can connect applications to other applications via the Web?
The answer to that is the XMLHttpRequest object, which is another type of Web client. Using this object you can send and receive information to and from a Web resource in various formats, as shown in the following code:
var httpOb = new ActiveXObject("Microsoft.XMLHTTP");
httpOb.Open("POST","#", false);
httpOb.send(MySOAPMessage);
var Ans = httpOb.GetResponseXML();
The .NET Framework has a request/response model for accessing data from the Web. Applications that use the request/response model can request data from the Web in a protocol-agnostic manner—the application works with instances of a Web client (the WebRequest & WebResponse classes), while the details of the request are carried out by protocol-specific descendant classes. The .NET Framework provides a rich class structure for enabling the request/response model. The base classes for that are WebRequest & WebResponse. In my Web client, their descendants—the HTTPWebRequest & HTTPWebResponse classes—play a major role.
0 comments:
Post a Comment