title: request body empty with POST node js ajax calling with json web token
body: <p>can you help me~</p>
  
  <p>I am trying to use json webtoken on node js and calling post method to set data.</p>
  
  <p>Code on node js server:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.use(bodyParser.raw({ type: 'application/jwt' }));</code></pre>
  </div>
  </div>
  </p>
  
  <p>Code frontend call:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$.ajax({
              url: '/setSession',
              type: 'POST',
              Accept : 'application/json',
              //contentType: 'application/json',
              dataType: 'json',
              data: { "hello": templateName}, 
              //data: JSON.stringify({ "hello": templateName}), 
              headers: {
                 'Authorization': 'Bearer '+ token
              },
              success: function (result) {console.log('post ok'+JSON.stringify(result));
                  // CallBack(result);
              },
              error: function (error) { console.log('post failed'+JSON.stringify(error));
           
              }
           });</code></pre>
  </div>
  </div>
  </p>
  
  <p>but  req.body when calling post request is empty or {}, I tried bodyparser, or dataType but no success</p>