如何设置Winhttp.dll的Option

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

如何设置Winhttp.dll的Option

16 Aug 2016, 22:03

请教个问题.

我开始使用Winhttp.dll,用的是这个地方的
https://autohotkey.com/boards/viewtopic ... 038#p21986
HttpRequest()


几乎所有的脚本都转换成功了,只剩下临时在CreateFormData()写的示例,设置选项的地方.
ComObjCreate("WinHttp.WinHttpRequest.5.1")这样设置:

Code: Select all

whr.Option(6) := False ; No auto redirect
但在HttpRequest(),是这样的

Code: Select all

    ;Set session options
    For optionKey, optionValue in sessionOptions
    {
        oResult := DllCall("Winhttp.dll\WinHttpSetOption"
               ,HINTERNET,hConnect
               ,DWORD,optionKey
               ,LPVOID,&optionValue
               ,DWORD,StrLen(optionValue))
        If !(oResult)
            Return % {Body:"",Headers:{},StatusCode:0,StatusText:"",HttpVersion:"",Error:"Setting session option #" . A_Index . " failed"}
    }
这样设置显然是无效的

Code: Select all

sessionOptions:={6:False}
请问应该怎么设置呢?

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 8 guests