【问题标题】:WinHttp Post fail to retrieve website contentWinHttp Post 无法检索网站内容
【发布时间】:2011-07-27 03:43:56
【问题描述】:

调用 https 时会出现此问题,但调用 http 时可以正常工作。

我该如何解决这个问题?

完整的工作代码如下:

Option Explicit
On Error Resume Next

Dim strURL, objWinHttp, strResponse


Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"


'Calling to https fail to retrieve content

strURL= "https://210.5.42.59:8443/sitepreview/http/test2.com/readme.txt"
WScript.Echo strURL

strResponse= CallHTTPTest(strURL)
WScript.Echo strResponse


'Calling to http successfully retrieve content

strURL= "http://ezinearticles.com/?How-To-Clean-a-Car-With-Car-Signs&id=6452594"
WScript.Echo strURL

strResponse= CallHTTPTest(strURL)
WScript.Echo strResponse



Function CallHTTPTest(strURL)

    objWinHttp.Open "POST", strURL, false
    objWinHttp.Send 

    objWinHttp.SetTimeouts 5000, 60000, 30000, 420000
    objWinHttp.WaitforResponse(440000)

    CallHTTPTest= objWinHttp.ResponseText

End Function

【问题讨论】:

    标签: post web winhttp


    【解决方案1】:

    我认为您将不得不协商 SSL 证书:

    Using SSL with WinHTTP

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 2011-08-10
      • 1970-01-01
      • 2011-02-02
      • 1970-01-01
      • 2018-11-26
      相关资源
      最近更新 更多