获取/发布到 RESTful Web 服务 [英] Get/post to RESTful web service
本文介绍了获取/发布到 RESTful Web 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从 VB6 对 RESTful Web 服务执行一些 GET 和 POST 操作.最好和最简单的方法是什么?
I need to do some GETing and POSTing to a RESTful web service from VB6. What is the best and simplest way to do that?
推荐答案
您需要添加对 MSXML 库的引用:
You'll need to add a reference to the MSXML library:
Dim sUrl As String
Dim response As String
Dim xmlhttp
Set sUrl = "http://my.domain.com/service/operation/param"
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", sURL, False
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send()
Dim response As String = xmlhttp.responseText
Set xmlhttp = Nothing
这篇关于获取/发布到 RESTful Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文