title: Why is my POST request not working in Node
body: <p>I am very very stuck in this "almost there" type of problem. I am new to programming but got along just fine until I came across this issue.</p>
  
  <p>So, I have this POST call to put a new user, which I get from Facebook using Passpost.js, if the "id" does not exist.</p>
  
  <p>Here is the POST call (using "request" module):</p>
  
  <pre><code>passport.use(new FacebookStrategy({
      clientID: config.facebook.appID,
      clientSecret: config.facebook.appSecret,
      callbackURL: config.facebook.callbackURL,
      profileFields: ['id', 'displayName', 'photos', 'emails', 'birthday', 'location', 'bio', 'likes.limit(100)']
  },
  function(accessToken, refreshToken, profile, done){
      userModel.findOne({'profileID':profile.id}, function(err, result){
          if(result){
              done(null, result);
          } else {
              request({
                  url: 'http://localhost:3000/api/user',
                  qs: {id:  'profile.id',},
                  method: 'POST',
                  json: {
                      fullname:   profile.displayName,
                      profilePic: profile.photos[0].value || '',
                      email:      profile.emails[0].value || '',
                      birthday:   profile._json.birthday || '',
                      location:   profile._json.location.name || '',
                      about:      profile._json.bio || '',
                      likes:      profile._json.likes || ''
                  }
              }, function(error, response, body){
                  if(error) {
                      console.log(error);
                  } else {
                      console.log(response.statusCode, body);
                  }
              });
  
          }
      })
  
  
  }
  )
  )
  </code></pre>
  
  <p>I am grabbing the POST call on my router like this:</p>
  
  <pre><code>apiRouter.post('/api/user', secureAPIPages, function(req, res, next){
      userModel.findOne({'profileID':req.query.id}, function(err, result){
          if(result){
              console.log('User exists already');
          } else {
  
              var newUser = new userModel({
                  profileID   :   res.query.id,
                  fullname    :   res.json.displayName,
                  profilePic  :   res.json.photos || '',
                  email       :   res.json.emails || '',
                  birthday    :   res.json.birthday || '',
                  location    :   res.json.location || '',
                  about       :   res.json.bio || '',
                  likes       :   res.json.likes || ''
              });
  
              newUser.save(function(err){
                  console.log('User has been saved');
              })
          }
      })
  })
  </code></pre>
  
  <p>I get this from the POST call: 302 undefined (302 being the statusCode and undefined being the body from the POST call in the request module).</p>
  
  <p>This is really a two part question:</p>
  
  <p><strong>1)</strong> Why is my POST call not working?
  <strong>2)</strong> Does my apiRouter.post route look okay?</p>
  
  <p>It may be something very simple but I have spent countless hours to try and debug this but I am really not getting anywhere.</p>
  
  <p>Your help will highly be recommended.</p>
  
  <p>Thanks,
  Shayan</p>