次のような単純な作業superagent
/async
ウォーターフォール リクエストがあります。
request = require 'superagent'
user = request.agent()
async.waterfall [
(cb)->
user.post('http://localhost:3000/form').send(name: 'Bob').end(cb)
], (err, res)->
console.log err
console.log res
これにより、完全な http 応答が正常に出力されerr
、undefined
.
追加の手順でまったく同じことを実行すると、次のようになります。
request = require 'superagent'
user = request.agent()
async.waterfall [
(cb)->
user.post('http://localhost:3000/form').send(name: 'Bob').end(cb)
(err, res)->
# this is never reached
cb()
], (err, res)->
console.log err # this now prints out the response
console.log res # this is undefined
err
が応答になりました。res
未定義です。これはsuperagent
私がここで遭遇している問題ですか、それとも単純にasync
'sをwaterfall
間違って使用していますか?