title: How to know that in lambda,when to use event and event.body
body: <p>I am new on writing lambda using nodejs. I need to write an API to let user login and send back an access token. </p>
  
  <p>So I study others example and I found that sometimes when I write a post method the body (e.g. <code>{'username':'***' , 'password' : '***'}</code>) can be accessed let say </p>
  
  <pre class="lang-js prettyprint-override"><code>exports.handler = async event =&gt; { console.log(event.body) }
  </code></pre>
  
  <p>and sometimes can only be called by </p>
  
  <pre class="lang-js prettyprint-override"><code>exports.handler = async event =&gt; { console.log(event) }
  </code></pre>
  
  <p>I have tried to use postman to check the difference between their codes and my code. Even if I copy the example I can only access the body in the <code>event</code> but not <code>event.body</code>. Can anyone explain me why there is this difference?</p>