解决方法@H_301_10@
Sub XMLPost()
Dim xmlhttp,sData As String
With ActiveSheet
sData = "x=" & URLencode(.Range("A2").Value) & _
"&y=" & URLencode(.Range("B2").Value)
End With
Set xmlhttp = CreateObject("microsoft.xmlhttp")
With xmlhttp
.Open "POST"," http://testingHttpPost/",False
.setrequestheader "Content-Type","application/x-www-form-urlencoded"
.send sData
Debug.Print .responsetext
End With
End Sub
对于URLencode功能,请参见此处:How can I URL encode a string in Excel VBA?
Sub XMLPost() Dim xmlhttp,sData As String With ActiveSheet sData = "x=" & URLencode(.Range("A2").Value) & _ "&y=" & URLencode(.Range("B2").Value) End With Set xmlhttp = CreateObject("microsoft.xmlhttp") With xmlhttp .Open "POST"," http://testingHttpPost/",False .setrequestheader "Content-Type","application/x-www-form-urlencoded" .send sData Debug.Print .responsetext End With End Sub
对于URLencode功能,请参见此处:How can I URL encode a string in Excel VBA?