今天在查看微软XML4.0 SDK帮助时发现一个错误,该错误存在于 DOM Reference > XML DOM Methods > setRequestsHeader Method (IXMLHTTPRequest) 中。该主题的Examples部分有如下几行代码:
myhttp.open "GET", "http://SamplesServer/httpreqserver.asp", false
' Simulate message sent by a custom user agent.
myhttp.setRequestHeader "User-Agent", "MyCustomUser"
mydata.async=false
myhttp.send mydata.XMLDocument
其中第一行的GET应为POST,否则httpreqserver.asp将收不到客户端发送的内容,Request.Totalbytes将为0。
myhttp.open "GET", "http://SamplesServer/httpreqserver.asp", false
' Simulate message sent by a custom user agent.
myhttp.setRequestHeader "User-Agent", "MyCustomUser"
mydata.async=false
myhttp.send mydata.XMLDocument
其中第一行的GET应为POST,否则httpreqserver.asp将收不到客户端发送的内容,Request.Totalbytes将为0。
作者查看微软XML4.0 SDK帮助时,发现DOM Reference中setRequestsHeader Method主题Examples部分代码有误。第一行的GET应改为POST,不然httpreqserver.asp收不到客户端内容,Request.Totalbytes为0。
2087

被折叠的 条评论
为什么被折叠?



