【发布时间】:2011-07-19 05:51:22
【问题描述】:
插件方面和 HTTPBuilder 方面似乎都缺乏文档。我正在尝试通过 put 方法提交一些 json,但它一直告诉我 put() 不喜欢我提供的地图。
有人有使用 Grails REST 客户端插件的 PUT 示例吗?这是我尝试过的:
withHttp(uri: "http://foo/doo/roo") {
def bodyContent = [
pano: jsonText
]
def json = put(body: bodyContent)
if (json.stat == 'ok') {
wsr.success = true
}
}
错误:
No signature of method: com.wbr.pano.PanService.put() is applicable for argument types: (java.util.LinkedHashMap) values: [[body:
{
"class":"com.wbr.platform.Pano",
"errorMessage":"null",
"imageSize":0,
"id":26,
"completed":"2011-03-20 3:50:27.257",
"downloading":"2011-03-20 3:49:12.269",
"processing":"2011-03-20 3:49:42.911",
"uploading":"2011-03-20 3:50:12.107"
}
]]
【问题讨论】:
-
你能发布你得到的错误信息/堆栈跟踪吗?
-
添加了错误信息。实际的堆栈跟踪要神秘得多。
标签: rest grails grails-plugin httpbuilder