XMLHTTP与ServerXMLHTTP的区别

在服务器端用ASP来取得互联网上的任意文件使用ServerXMLHTTP或许更加合适.可以设定过期时间可以让ASP程序更具效率和可靠性,如下表所示:

 
XMLHTTP


ServerXMLHTTP


1


Works on Windows 98, 95 and ME


Requires at least Windows NT 4 with IE5.01 .


2

 


Does not have a means of waiting for an async call other than using another thread to handle the response via onreadystatechange.

 

Another technique is to loop on the main thread, polling the readystate property.

For example:

 While xmlhttp.readystate <> 4

   ' async request not complete yet; still waiting

 Wend

 

But this is not as efficient as the ServerXMLHTTP's WaitForResponse method


Has a waitForResponse method with a timeout when using async calls.


3


 


Allows configuring timeouts when sending messages.


4


Is designed for single-user, desktop applications, such as running in a browser-based app.

 

XMLHTTP's assumption that it is used only in single-user environments has security implications.

Do not use XMLHTTP in multi-user scenarios such as on IIS/ASP servers.

Also, in various cases, XMLHTTP may display UI dialogs (to collect credentials).


Supports multi-user, server-based applications, such as ASP apps.


5


Because XMLHTTP is designed for single-user client applications and is based on WinInet, it enforces strict limits on the number of simultaneous connections to a given server.

The limit is either 2 or 4 (depending on HTTP version).


The ServerXMLHTTP component does not impose any limits on the number of connections to a server.


6


XMLHTTP integrates with the IE browser's cache, which may cause problems in which "stale" response data is returned.


ServerXMLHTTP does not implement a cache.


7


XMLHTTP is HTTP/1.1 compliant.

XMLHTTP does support HTTP/1.1 chunking.


ServerXMLHTTP reports itself as an HTTP/1.0 client.

The reason is that ServerXMLHTTP does not support the HTTP/1.1 response "chunking" feature, which is required for 1.1 compliance.


8


By using the IE browser's proxy settings, XMLHTTP can take advantage of IE's auto-detection of proxy servers.

If IE is configured to access sites via a proxy server, then all requests made via XMLHTTP will also go through the proxy.

However, IE (and thus XMLHTTP) can be configured to bypass the proxy server for certain sites (assuming that a direct connection to the target server can be made).

This is done in the "Tools/Internet Options/Connections/LAN Settings" dialog in IE.

The "Bypass proxy server for local addresses" option should be checked to have the proxy server bypassed for intranet sites.


ServerXMLHTTP does not support any auto-detection or discovery of proxy servers; you must explicitly specify the name of the proxy server using the proxycfg.exe utility.

Can be configured with WinHTTP proxy config to access other machines directly (no proxy server).


9


The XMLHTTP component in MSXML 3.0 supports automatic gzip decompression;


ServerXMLHTTP does not.

由此可见在服务器端用ASP来取得互联网上的任意文件使用ServerXMLHTTP或许更加合适.可以设定过期时间可以让ASP程序更具效率和可靠性

时间: 2024-08-24 03:46:50

XMLHTTP与ServerXMLHTTP的区别的相关文章

Msxml2.XMLHTTP Msxml2.ServerXMLHTTP与缓存_vbs

在大部分情况下,Msxml2.XMLHTTP 能够很好地完成工作,因为它是有缓存的.比如,我们用 Msxml2.XMLHTTP 发送 HTTP POST 请求模拟登陆了某个网站,它会把登陆时的 Cookie 和 Session 缓存下来,当我们想获取网站的数据时直接 HTTP GET 就行了,不需要人工发送 Cookie 和 Session. 但是,在有些时候,缓存会给我们造成麻烦.比如我们要写一个 VBS 脚本暴力破解某个网站的账号,假设我们已经破解了一个账号,继续破解时,由于缓存的关系,网站

解决xmlhttp在服务器生成大量cache文件的方法

一般在远程抓取网页内容时,通常都会用到如下代码: Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")xmlhttp.Open "GET", "http://diary.tw/tim/", Falsexmlhttp.SendResponse.Write xmlhttp.ResponseTEXTSet xmlhttp = Nothing 不过这个有一些些问题, 因为 XMLHTTP 本身的工作

网站静态页面生成及网站数据采集的攻防

采集|静态|数据|页面 本着互联网共享主义精神,特写此文献给建站新手,授人以鱼,不如授人以渔,本文所讲的只是方法和原理,希望大家看完此文,能够从中得到些帮助和启发. 本文从一个ASP程序员的角度用大量实例祥细介绍了动态网站如何生成静态页面原理,又从一个采集程序开发者的角度去祥细介绍了网站数据采集的原理及功防策略. 关于网站生成静态页面,为了让本文读者容易理解,文内列举了目前常用的多种生成静态页面的方法,其中用了很多的实例代码进行说明. 关于网站数据采集攻防,作者本身是一个采集程序的开发者,同时作

网站生成静态页面攻略

攻略|静态|页面 生成HTML方法主要步骤只有两个: 一.获取要生成的html文件的内容二.将获取的html文件内容保存为html文件 我在这里主要说明的只是第一步:如何获取要生成的html文件的内容: 目前常用获取html文件的内容的方法有几下几种: 1.这种方法与是在脚本内写要生成的html内容,不太方便预览生成页面的内容,无法可视化布局页面,更改html模板时会更加复杂.用这种方法的人很多,但我感觉这种方法是最不方便的. str="<html标记>内容</html标记&g

网站生成静态页面攻略 -- 生成静态页面的方法

攻略|静态|页面 生成HTML方法主要步骤只有两个: 一.获取要生成的html文件的内容二.将获取的html文件内容保存为html文件 我在这里主要说明的只是第一步:如何获取要生成的html文件的内容: 目前常用获取html文件的内容的方法有几下几种: 1.这种方法与是在脚本内写要生成的html内容,不太方便预览生成页面的内容,无法可视化布局页面,更改html模板时会更加复杂.用这种方法的人很多,但我感觉这种方法是最不方便的. str="<html标记>内容</html标记&g

网站生成静态页面,及网站数据采集的攻、防原理和策略_小偷/采集

发布时间:2005年11月27日 晚 文章作者:翟振凯 (小琦) 交流方式: 个人站:http://www.xiaoqi.net     技术站:http://www.iisvs.net 商业站:http://www.iisvs.com QQ:53353866 22336848 关于本文:         本着互联网共享主义精神,特写此文献给建站新手,授人以鱼,不如授人以渔,本文所讲的只是方法和原理,希 望大家看完此文,能够从中得到些帮助和启发.         本文从一个ASP程序员的角度用大

ASP网站生成静态html页面技术小结_应用技巧

生成HTML方法主要步骤只有两个:  一.获取要生成的html文件的内容  二.将获取的html文件内容保存为html文件  我在这里主要说明的只是第一步:如何获取要生成的html文件的内容:  目前常用获取html文件的内容的方法有以下几种:  1.  str="<html标记>内容</html标记>"  str=str&"<html标记>内容</html标记><html标记>数据库读取内容....<

ASP,PHP与.NET伪造HTTP-REFERER方法及防止伪造REFERER方法探讨_相关技巧

HTTP-REFERER这个变量已经越来越不可靠了,完全就是可以伪造出来的东东. 以下是伪造方法: ASP: 复制代码 代码如下: dim http   set http=server.createobject("MSXML2.XMLHTTP") '//MSXML2.serverXMLHTTP也可以  Http.open "GET",url,false   Http.setRequestHeader "Referer","http://

ASP,PHP与.NET伪造HTTP-REFERER方法及防止伪造REFERER的方法_安全相关

 HTTP-REFERER这个变量已经越来越不可靠了,完全就是可以伪造出来的东东. 以下是伪造方法: ASP/Visual Basic代码 dim http      set http=server.createobject("MSXML2.XMLHTTP") '//MSXML2.serverXMLHTTP也可以     Http.open "GET",url,false      Http.setRequestHeader "Referer",