【发布时间】:2012-11-23 14:15:25
【问题描述】:
我想与具有基于 URL 的 API 的网络服务通信。例如我有以下网址:
http://api.bla.com/aaa/bbb.ashx?Action=GetSecurityToken&vendorId=3
我可以将 URL 放入浏览器并获得一个 XML 页面,其中包含所有详细信息。
我想从我的 grails 应用程序中获取 XML 页面,因此我使用以下代码:
http = new HTTPBuilder('http://api.bla.com/aaa/bbb.ashx')
html = http.get( path : '/', query : [Action :"GetSecurityToken", vendorId: "3"] ) )
println html
为什么这不起作用。我收到一个错误的请求。如何在我的 grails 控制器中从上面的 URL 获取 xml 页面?
【问题讨论】:
标签: xml rest grails httpbuilder