找到一个 PUT 的函数,你照着改吧
Private Function POST(spost As String)As Boolean
'This is the Sub Script which will post the data to
'the XXX Portal, The Payload is the Data which is the actual data
'That is being sent to the XXX Data Server
'On Error Resume Next
Dim streamtext As Scripting.TextStream
Dim http As WinHttp.WinHttpRequest
Dim sstatus As String
Dim sdescription As String
Set http = New WinHttp.WinHttpRequest
http.Option(WinHttpRequestOption_SslErrorIgnoreFlags)= 13056
'Below is the B2B Portal Address
http.Open "POST", "https://XXX.XXX.XXX.XXX/XXX/XXX"
http.SetRequestHeader "Content-Type", "text/xml"
http.SetRequestHeader "Content-Length", LenB(spost)
'Below are the Username and Password, which are Hardcoded into the Script
http.SetCredentials "XXX", "XXX", 0
http.Send spost
sstatus = http.Status
Select Case sstatus
Case Is = "200"
POST = True
Case Else
POST = False
End Select
End Function