用于 grails 的 REST 客户端插件的最新版本:
withHttp(uri: "http://foo/bar") {
def bodyContent = [
apiKey: "somekey",
identifier: identity.identity,
activity: ac as JSON
]
def json = post(path: 'activity', body: bodyContent)
if (json.stat == 'ok') {
wsr.success = true
}
}
如何向此请求添加标头数据?