假设我有一小段代码:
var express = require('express');
var app = express();
app.get('/', function(req, res){
//I want to acccess 'req' and get info whether it's an AJAX call
});
app.listen(3000);
当我进入app.get(..)函数时,我想知道发送的get请求是否是一个AJAX调用。在对象'req'中,有哪个字段可以告诉我这一点?