Closed mgrant0 closed 9 years ago
It seems you're misunderstanding wait-for, req.on() and callbacks in general. You do not need wait-for for this case. Are you returning a get from other page on your post? acting like some kind of proxy? You'll need to do something like:
req.on('end', function() {
res.end( qs.parse(body) );
}
ah hah! Thanks. It took me a few times to look at this to realize and understand what you meant. But yes, of course, you are correct, just call res.end() when I finally have all the result in one place.
I receive a post and then I need to process the data that I get back. In order to read in the post, I have to call:
but unfortunately the page gets drawn while the req.on() functions are running, so I thought I would use wait.for as follows:
My problem is that the wait.forMethod() call never returns. Have I misunderstood something conceptually about how wait.forMethod() works?