getParams = function(req, callback){
    if(req.method=='POST') {
        var body = '';
        req.on('data', function(chunk){
            body += chunk;
        })
        .on('end', function() {
            var obj = querystring.parse(  body.replace( /\+/g, ' ' ) ) ;
            callback( obj );
        });
    }
    else if(req.method=='GET') {
        var url_parts = url.parse(req.url,true);
        callback(url_parts.query);
    }
}
Important note: this demo application is for CrossUI created by Alex Pavlov (macscripter@gmail.com)