+ -
当前位置:首页 → 问答吧 → 谁有XMLHTTP对象的资料?

谁有XMLHTTP对象的资料?

时间:2003-02-07

来源:互联网

想了解一点,可是手头没有好的资料,论坛没有XML版,就发到这里了。

英文的也无妨。谢谢

作者: bencalie   发布时间: 2003-02-07

无一人知晓?

我现在只有 MSXML 4.0 SDK

作者: bencalie   发布时间: 2003-02-09

呵. 这个你可以找下 Flashsoft  他最近在研究..

我是一直想学, 一直没时间.. :(

作者: ※潇洒※   发布时间: 2003-02-09

呵呵,MSDN到处是啊。
客户端一般用microsoft.xmlhttp
服务器端一般用msxml2.serverhttp吧。

作者: yesoul   发布时间: 2003-02-21

3.0的都有这些资料:

Microsoft XML 3.0 - XML Reference  

See Also
IXMLHTTPRequest
Language
C/C++

Script

Visual Basic

Show All
IXMLHTTPRequest Members  [C#]
[Visual Basic, Script]
The following tables show the properties, methods, and events.

[C/C++]
The following tables show the properties, methods, and events.

This interface inherits from IDispatch.

Properties


onreadystatechange* Specifies the event handler to be called when the readyState property changes. Read/write.
readyState Represents the state of the request. Read-only.
responseBody Represents the response entity body as an array of unsigned bytes. Read-only.
responseStream Represents the response entity body as an IStream. Read-only.
responseText Represents the response entity body as a string. Read-only.
responseXML Represents the response entity body as parsed by the Microsoft® XML Parser (MSXML). Read-only.
status Represents the HTTP status code returned by a request. Read-only.
statusText Represents the HTTP response line status. Read-only.

* denotes an extension to the Worldwide Web Consortium (W3C) Document Object Model (DOM).


Methods


abort Cancels the current HTTP request.
getAllResponseHeaders Retrieves the values of all the HTTP headers.
getResponseHeader Retrieves the value of an HTTP header from the response body.
open Initializes an MSXML2.XMLHTTP request, and specifies the method, URL, and authentication information for the request.
send Sends an HTTP request to the server and receives a response.
setRequestHeader Specifies the name of an HTTP header.


Events

None.

作者: Glacier   发布时间: 2003-03-02



QUOTE:
[i]not[/i] 于 2003-3-3 11:00 写道:
3.0的都有这些资料:

Microsoft XML 3.0 - XML Reference  

偶的是MSXML 4 SDK,比你的新哦,除了这个没有了?

作者: not   发布时间: 2003-03-03

倒,都一样

作者: bencalie   发布时间: 2003-03-03

Remarks
A client computer can use the XMLHTTP object (MSXML2.XMLHTTP) to send an arbitrary HTTP request, receive the response, and have the Microsoft® XML Document Object Model (DOM) parse that response.

This object is integrated with the Microsoft XML Parser (MSXML) to support sending the request body directly from, and parsing the response directly into, the MSXML DOM objects. When combined with the support for Extensible Stylesheet Language (XSL), the XMLHTTP component provides an easy way to send structured queries to HTTP servers and efficiently display the results with a variety of presentations.

The usual sequence is to call open, set any custom header information through setRequestHeader followed by send, and then to check one of the four different response properties.

[Script]
Example
The following Microsoft JScript® example posts a DOMDocument containing order information to an Active Server Pages (ASP) page on a server and returns the result as a new XML document.

<script language="JScript">
  function PostOrder(xmldoc)
  {   
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
    xmlhttp.Send(xmldoc);
    return xmlhttp.responseXML;
  }
</script>
The ASP page on the server loads the posted XML document, processes the order, and builds a resulting XML document.

<%@ language=javascript %>
<%
    Response.Expires = -1000;
    // Load the posted XML document.
    var doc = Server.CreateObject("Msxml2.DOMDocument");
    doc.load(Request);
    var result = Server.CreateObject("Msxml2.DOMDocument");
    // Now process the order and build the result document.
    Response.ContentType = "text/xml";
    result.save(Response);
%>
[Visual Basic]
The following Microsoft Visual Basic® example creates an XMLHTTP object and asks a server for an XML document. The server sends back an XML document that is displayed by the code snippet.

Private Sub Command1_Click()
  Dim HttpReq As New MSXML2.XMLHTTP
  
  HttpReq.open "GET", "http://XMLSampleServer/CatalogServer.asp", False
  HttpReq.send
  MsgBox HttpReq.responseText
End Sub
[C/C++]
The following C/C++ example creates an XMLHTTP object and asks a server for an XML document. The server sends back an XML document that is displayed by the code snippet.

#import "msxml3.dll"
using namespace MSXML2;

void XMLHttpRequestSample()
{
   IXMLHTTPRequestPtr pIXMLHTTPRequest = NULL;
   BSTR bstrString = NULL;
   HRESULT hr;

   try {
      hr=pIXMLHTTPRequest.CreateInstance("Msxml2.XMLHTTP");
      SUCCEEDED(hr) ? 0 : throw hr;

      hr=pIXMLHTTPRequest->open("GET", "http://XMLSampleServer/CatalogServer.asp", false);
      SUCCEEDED(hr) ? 0 : throw hr;

      hr=pIXMLHTTPRequest->send();
      SUCCEEDED(hr) ? 0 : throw hr;
      
      bstrString=pIXMLHTTPRequest->responseText;

      MessageBox(NULL, _bstr_t(bstrString), _T("Results"), MB_OK);

      if(bstrString)
      {
         ::SysFreeString(bstrString);
         bstrString = NULL;
      }

   } catch (...) {
      MessageBox(NULL, _T("Exception occurred"), _T("Error"), MB_OK);
      if(bstrString)
         ::SysFreeString(bstrString);
   }

}

作者: flashsoft   发布时间: 2003-03-03

4.0的应该更新些!

作者: not   发布时间: 2003-03-03

这句话把他的作用说得很清楚了:

send an arbitrary HTTP request, receive the response, and have the Microsoft® XML Document Object Model (DOM) parse that response.

开发的思路应该很清楚了,你再问个具体问题吧!

作者: not   发布时间: 2003-03-03

MSDN 里面也就这些,自己研究吧

作者: not   发布时间: 2003-03-03

相关阅读 更多

热门下载

更多