当我运行下面的代码时,我无法获取响应文本和返回的响应正文。“HTTP/1.1 200 OK”消息与响应标头一起返回,但没有响应正文。我已经使用 Fiddler2 确认了这个结果,并且还查看了 netsh 跟踪日志。
例如,其他 URL(http://real-chart.finance.yahoo.com/table.csv?s=CELG&d=6&e=26&f=2014&g=d&a=2&b=26&c=1990&ignore=.csv)返回响应文本为以及响应机构。
为什么这个 URL 有问题,我怎样才能让它返回响应正文?
Sub testlogin()
fileUrl = "http://financials.morningstar.com/ajax/ReportProcess4CSV.html?t=XNYS:HFC®ion=USA&culture=en-US&productCode=COM&reportType=is&period=&dataType=A&order=desc&columnYear=5&rounding=3&view=raw"
Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5.1")
WHTTP.Open "GET", fileUrl, False
WHTTP.Send
MsgBox WHTTP.Status
MsgBox WHTTP.ResponseText
MsgBox WHTTP.ResponseBody
MsgBox WHTTP.GetAllResponseHeaders
Set WHTTP = Nothing
End Sub