title: Node js post request body in Joi Validation Package
body: <p>Recently I am working with node js and <a href="https://www.npmjs.com/package/joi" rel="nofollow noreferrer">Joi a validation package for node</a>. I send post data through <a href="http://getpostman.com/" rel="nofollow noreferrer">postman</a> using the body, no params. But in node js application the request body shows undefined. Here are the snips:</p>
  
  <pre><code>const express = require('express');
  const Joi = require('joi');
  const app = express();
  
  app.listen(3000, () =&gt; 'Server is listening on 3000');
  
  app.post('/users', (request, response) =&gt; {
      const schema = Joi.object().keys({
          username: Joi.string()
              .alphanum()
              .min(3)
              .max(30)
              .required()
      });
  
      const result = Joi.validate(request.body, schema);
      response.send(result);
  });
  </code></pre>