Q:

Unable to send JSON to Express router using AJAX request with JSON.stringify(..)

I am trying to make this trivial example work, which will be part of a username and password login verification system:
I want to send my user info as JSON to the server, and validate the information on the server side.  Unfortunately, my server does not seem to understand the JSON data from the client, and all of my attempts are undefined (server/client logs below). 
Here is my relevant information:
app.js:
var login = require('./routes/login');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

app.use(favicon());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/login', login);

login.js:
var express = require('express');
var router = express. Router();

// * VERIFY users listing. */ 
router.get('/verify', function(req, res) {
    console.log("verifying...");
    console.log("userinfo: " + req.params.username);
    console.log("userinfo: " + req.username);
    console.log("userinfo: " + req.query.username);

    res.send(
        (err === null) ? {  msg: 'Done with verfications' } : { msg: err }
    );

});

webapp_login.js:
var userinfo = {username: 'lucas', password: '81dc9bdb52d04dc20036dbd8313ed055'};
console.log("sending userinfo to server: " + userinfo);
$.ajax({
    type: 'GET',
    data: JSON.stringify(userinfo), 
    contentType: 'application/json; charset=utf-8',
    url: '/login/verify'
}).done(function(response) {
    alert(msg);
});

Unfortunately, here is my server output:
GET /login/webapp_login.html 304 8ms
GET /javascripts/jquery-md5.js 304 5ms
GET /login/webapp_login.css 304 2ms
GET /login/webapp_login.js 200 7ms - 3.56kb
verifying...
userinfo: undefined
userinfo: undefined
userinfo: undefined
GET /login/verify?{%22username%22:%22lucas%22,%22password%22:%2281dc9bdb52d04dc20036dbd83
13ed055%22} 500 235ms - 1.48kb                                                          

And my browser console output:
sending userinfo to server: [object Object]
webapp_login.js (line 30)
GET http://localhost:3002/login/verify?{%22username%2...sword%22:%2281dc9bdb52d04dc20036dbd8313ed055%22}

500 Internal Server Error
        237ms   
jquery.min.js (line 4)
"NetworkError: 500 Internal Server Error - http://localhost:3002/login/verify?{%22username%22:%22lucas%22,%22password%22:%2281dc9bdb52d04dc20036dbd8313ed055%22}"

I suspect something may be wrong with my JSON parser.  It seems that most other people are using express.json(), but I would like another opinion before I start installing more Express bundles. 

A:

JSON.stringify will convert a dictionary object to string, so don't use it. 
and req.query (in case of GET request), cannot parse the that JSON.stringify dictionary
So, always pass query string data to both GET and POST ajax request as:
data: {'username': 'xyz', 'password': 'abc'} 

