我怎样才能找到第三个& MSXML2.ServerXMLHTTP的第四个参数'打开方法?

时间:2013-09-04 07:35:09

标签: com vbscript httprequest

我使用以下代码:

 Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
 objXMLHTTP.Open "POST", URL + "/" + Method, false,UID,PASSWORD
 objXMLHTTP.Send ' Not sending custom parameters
 WScript.Sleep 500
 Loop
 MsgBox objXMLHTTP.responseTEXT 

有没有办法检索URL内发送的UID和PASSWORD(我已经获得了Web服务的代码)?

PS:我寻求的信息不在HttpRequest.Current.Request.Headers中。

1 个答案:

答案 0 :(得分:1)

AFAIK您需要为POST请求设置标头Content-Type: application/x-www-form-urlencoded,因此请尝试将代码更改为:

Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objXMLHTTP.Open "POST", URL + "/" + Method, False, UID, PASSWORD
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLHTTP.Send