打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
WinHttp.WinHttpRequest.5.1

不多解释,小偷组件必备逆天神器,最新版,WinHttp.WinHttpRequest.5.1。相比之下,MSXML2.ServerXMLHTTP.6.0 成了不成器的垃圾了。反正就是各种功能各种支持,这里仅做备用索引。

MSDN:WinHttpRequest对象参考指南

事件:

EventDescription
OnError Occurs when there is a run-time error in the application.
OnResponseDataAvailable Occurs when data is available from the response.
OnResponseFinished Occurs when the response data is complete.
OnResponseStart Occurs when the response data starts to be received.

方法:

MethodDescription
Abort Aborts a WinHTTP Send method.
GetAllResponseHeaders Retrieves all HTTP response headers.
GetResponseHeader Retrieves the HTTP response headers.
Open Opens an HTTP connection to an HTTP resource.
Send Sends an HTTP request to an HTTP server.
SetAutoLogonPolicy Sets the current Automatic Logon Policy.
SetClientCertificate Selects a client certificate to send to a Secure Hypertext Transfer Protocol (HTTPS) server.
SetCredentials Sets credentials to be used with an HTTP server—either an origin or a proxy server.
SetProxy Sets proxy server information.
SetRequestHeader Adds, changes, or deletes an HTTP request header.
SetTimeouts Specifies, in milliseconds, the individual time-out components of a send/receive operation.
WaitForResponse Specifies the wait time, in seconds, for an asynchronous Send method to complete, with optional time-out value.

属性: 

PropertyAccess typeDescription
Option Read/write Sets or retrieves a WinHTTP option value.
ResponseBody Read-only Retrieves the response entity body as an array of unsigned bytes.
ResponseStream Read-only Retrieves the response entity body as an IStream.
ResponseText Read-only Retrieves the response entity body as text.
Status Read-only Retrieves the HTTP status code from the last response.
StatusText Read-only Retrieves HTTP status text.

选项(Option)属性:

// Define the constants used by the option property.
WinHttpRequestOption_UserAgentString = 0;    // Name of the user agent
WinHttpRequestOption_URL = 1;                // Current URL
WinHttpRequestOption_URLCodePage = 2;        // Code page
WinHttpRequestOption_EscapePercentInURL = 3; // Convert percents
                                             // in the URL
 
// Instantiate a WinHttpRequest object.
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
 
// Initialize an HTTP request. 
WinHttpReq.Open("GET", "http://www.playes.net/", false);
 
// Send the HTTP request.
WinHttpReq.Send();
 
// Display the WinHTTP option values.
WScript.Echo( 'User agent:      '+
             WinHttpReq.Option(WinHttpRequestOption_UserAgentString));
WScript.Echo( 'URL:             '+
             WinHttpReq.Option(WinHttpRequestOption_URL));
WScript.Echo( 'Code page:       '+
             WinHttpReq.Option(WinHttpRequestOption_URLCodePage));
WScript.Echo( 'Escape percents: '+
          WinHttpReq.Option(WinHttpRequestOption_EscapePercentInURL));

选项(Option)属性枚举:

typedef enum WinHttpRequestOption {
  WinHttpRequestOption_UserAgentString,
  WinHttpRequestOption_URL,
  WinHttpRequestOption_URLCodePage,
  WinHttpRequestOption_EscapePercentInURL,
  WinHttpRequestOption_SslErrorIgnoreFlags,
  WinHttpRequestOption_SelectCertificate,
  WinHttpRequestOption_EnableRedirects,
  WinHttpRequestOption_UrlEscapeDisable,
  WinHttpRequestOption_UrlEscapeDisableQuery,
  WinHttpRequestOption_SecureProtocols,
  WinHttpRequestOption_EnableTracing,
  WinHttpRequestOption_RevertImpersonationOverSsl,
  WinHttpRequestOption_EnableHttpsToHttpRedirects,
  WinHttpRequestOption_EnablePassportAuthentication,
  WinHttpRequestOption_MaxAutomaticRedirects,
  WinHttpRequestOption_MaxResponseHeaderSize,
  WinHttpRequestOption_MaxResponseDrainSize,
  WinHttpRequestOption_EnableHttp1_1,
  WinHttpRequestOption_EnableCertificateRevocationCheck
} WinHttpRequestOption;

好劲。无所不能,绝对无敌。WinHttp.WinHttpRequest.5.1!

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
使用 WinHttpRequest 伪造 Referer 和cookie
掌控POST(2)
Delphi - 我的代码之简单封装WinHttpRequest
VB 6.0用SOAP去访问Webservice
Python 异步 IO 的未来(从 Web 后端开发的角度)
从论坛网友回复中提取出邮箱地址 | VBA实例教程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服