有没有人知道如何获取或发布回复使用JSON的RESTful Web服务?
例如,我想打电话给这个网址:www.web1.service.com/?apikey = 111-222-333& param1 = Adam& param2 = Smith?
此RESTful Web服务将使用JSON进行回复。
感谢。
AE
答案 0 :(得分:1)
我找到了答案:(您需要在Project-> References中添加对Microsoft XML,v4.0的引用...)
Private Function urlLaunch(ByVal URL As String) As String
Dim Ans As String
Dim oHTTP As MSXML2.XMLHTTP, sBuffer As String
Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oHTTP.Open "GET", URL, False
oHTTP.Send
sBuffer = oHTTP.responseText
Set oHTTP = Nothing
urlLaunch = sBuffer
End Function