Sending a json response in node js without status
<p>I am trying to send a json response to a GET call from node js server.
I am creating a json as follows </p>

<pre><code>var request = require('request');
var parseString = require('xml2js').parseString;


env.server.get('localhost:3000/details', function(req, res) {
                if (req.query.code) {
                    request.get({
                        url: 'http://www.example.com/net2/getDetails?code=' + req.query.code
                    }, function(err, result, body) {
                        if (err) {
                            console.log('error :' + err);
                            res.status(404).json({
                                infoMsg: "Error"
                            });
                        } else if (result.statusCode == 200) {
                            var resultBody = {};
                            parseString(body, function(e, parsedResult) {

                                resultBody["userName"] = parsedResult.userName;
                                resultBody["userDept"] = parsedResult.department;
                                resultBody["userCat"] = parsedResult.category;
                                res.send(resultBody);
                            });
                        }
                    })
                } else {
                    console.log('Request failed .');
                }
            });
</code></pre>

<p>I am expecting a result which needs to be in this format </p>

<pre><code>{
    "name": "test",
    "dept": "dept1",
    "cat": "cat2"
}
</code></pre>

<p>But the response which I am getting is in this format </p>

<pre><code>{
  "status": "success",
  "data": {
    "name": "test",
    "dept": "dept1",
    "cat": "cat2"
  }
}
</code></pre>

<p>How to create a response which is in the expected format ie without status and data being added, where am I going wrong.</p>