I was just wondering whether there are any standard techniques for
getting post parameters from the body. Here is something i copied from
nodewiki:
function getPostParams(req, callback){
var body = '';
sys.puts('in here');
req.addListener('body', function(chunk){body += chunk;})
.addListener('complete', function(){
callback(unescape(body.substring(8).replace(/\+/g,' ')));
});
}
It doesn't seem to work, and the process just hangs (in the callback,
i just did sys.puts('done'); sys.puts(content); where content is the
sole parameter for the callback. Only 'done' gets printed).
Is there any better way of doing it?
Any enlightenment would be much appreciated!
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
Jason
> > nodejs+un...@googlegroups.com<nodejs%2Bunsu...@googlegroups.com>