title: Obtain data from a GET in superagent function
body: <p>I'm trying to do something like this:</p>
  
  <pre><code>var countElemnts = function() {
              superagent
                .get('/someOtherUrl')
                .query({
                  type: value.type
                })
                .end(function(err, res) {
                  console.log(JSON.stringify(res.body));
                  if (res.ok) {
                    reply(JSON.stringify(res.body));
                  } else {
                    console.log(err);
                  }
                })
            };
            superagent
              .post('/someUrl')
              .type('json')
              .send({
                name: 'value.update',
                data: {
                  id: request.params.id,
                  type: value.type,
                  count: countElemnts()
                }
              })
              .end(function() {
                reply({
                  message: 'ok'
                });
              });
  </code></pre>
  
  <p>In data option of the send function I'm trying to call a function to obtain some value.</p>
  
  <p>What I want is to get the value that comes in the body of a reply, ie the res.body. Upon console.log get this [{ "count ": 3 } ], but if I do a console.log of res.body.count tells me undefined, what could I do to get the value 3. </p>
  
  <p>Thanks.</p>