函数参考


_WinHttpSimpleSendSSLRequest

使用SSL请求发送一个简单的表单,但不读取数据

#Include <WinHttp.au3>
_WinHttpSimpleSendSSLRequest($hConnect [, $sType [, $sPath [, $sReferrer = Default [, $sData = Default [, $sHeader = Default ]]]]])

参数

$hConnect _WinHttpConnect 函数返回的句柄
$sType [可选参数] GET 或 POST (默认: GET)
$sPath [可选参数] 请求路径 (默认: "" - 空字符串;表示服务器上的默认页)
$sReferrer [可选参数] 引用页面 (默认: $WINHTTP_NO_REFERER)
$sData [可选参数] POST数据 (默认: $WINHTTP_NO_REQUEST_DATA)
$sHeader [可选参数] 附加头 (默认: $WINHTTP_NO_ADDITIONAL_HEADERS)

返回值

成功: 返回 _WinHttpReceiveResponse 函数之后的请求句柄.
失败: 返回 0 并设置@error
1 - 无法打开请求
2 - 无法发送请求
3 - 无法接收响应

注意/说明

None.

相关

_WinHttpSimpleSSLRequest, _WinHttpSimpleSendRequest, _WinHttpSimpleReadData

示例/演示


#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include "WinHttp.au3"

Opt("MustDeclareVars", 1)

; Windows Live ID. JavaScript required to sign in, remember that.
Global $sDomain = "accountservices.passport.net"
Global $sPage = "uiresetpw.srf"

; 初始化并获取会话句柄
Global $hOpen = _WinHttpOpen()
; 获取连接句柄
Global $hConnect = _WinHttpConnect($hOpen, $sDomain)

; 生成简单的 SSL 请求
Global $hRequestSSL = _WinHttpSimpleSendSSLRequest($hConnect, Default, $sPage)

; 读取...
Global $sReturned = _WinHttpSimpleReadData($hRequestSSL)
; 关闭句柄
_WinHttpCloseHandle($hRequestSSL)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

; 看看返回的是什么
ConsoleWrite($sReturned & @CRLF)
MsgBox(64 + 262144, "Done", "Page source is printed to console")