【发布时间】:2014-03-04 14:49:53
【问题描述】:
我正在尝试使用 coffeeScript 发出 get 请求,但它甚至没有向我的 URL 发出请求:
module.exports = (robot) ->
robot.respond /foo (.*) bar (.*) foobar (.*) /i, (msg) ->
foo = msg.match[1]
bar = msg.match[2]
foobar = msg.match[3]
robot.http("http://localhost:8000/a/")
.query({
'foo': foo
'bar': bar
'foobar': foobar
})
.get() (err, res, body) ->
json = JSON.parse(body)
msg.send(json)
当我用我的浏览器发出相同的请求时,它可以工作:
http://localhost:8000/a/?foo=1&bar=2&foobar=3
我正在尝试将 hubot 运行为
hubot 1 bar 2 foobar 3
【问题讨论】:
标签: django coffeescript hubot