WinHttp.WinHttpRequest.5.1

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

MSDN:WinHttpRequest对象参考指南

事件:

Event Description
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.

方法:

Method Description
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.

属性:

Property Access type Description
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!

2 thoughts on “WinHttp.WinHttpRequest.5.1

  1. coretop

    无错,都是英文的,英文差,很吃力,相关的例子也很好,搜索了下找到很少的资源

  2. flow

    无所不能?伪造客户端IP给我看看。嘿嘿。说着玩的。