title: AWS Lambda, what type of request does the test button do?
body: <p>AWS Lambda newbie here.
  I was doing some testing with AWS Lambda functions and there is something that it is not working correct for me.
  Given this lambda function:</p>
  
  <pre><code>exports.handler = async (event, context, callback) =&gt; {
      var response = {
          statusCode: 200,
          headers: {'Content-Type': 'application/json'},
          response: event.talk
      };
      callback(null, response);
  };
  </code></pre>
  
  <p>When I press the <a href="https://i.stack.imgur.com/0aLhN.jpg" rel="nofollow noreferrer">test button</a> with this content (<a href="https://i.stack.imgur.com/IF3V6.jpg" rel="nofollow noreferrer">here</a> is a screenshot):</p>
  
  <pre><code>{
     "talk": "Hello World"
  }
  </code></pre>
  
  <p>I get this response (<a href="https://i.stack.imgur.com/zpRqi.jpg" rel="nofollow noreferrer">here</a> is a screenshot):</p>
  
  <pre><code>{
    "statusCode": 200,
    "headers": {
      "Content-Type": "application/json"
  },
    "response": "Hello World"
  }
  </code></pre>
  
  <p>But when I make a POST request (I added an open API gateway, see it <a href="https://i.stack.imgur.com/cmz5m.jpg" rel="nofollow noreferrer">here</a>), it just returns empty data and sometimes internal server error (<a href="https://i.stack.imgur.com/DW1ou.jpg" rel="nofollow noreferrer">here</a> is a screenshot):</p>
  
  <pre><code>no data
  </code></pre>
  
  <p>If I modify my Lambda function to JSON parse the body, it will work</p>
  
  <pre><code>exports.handler = async (event, context, callback) =&gt; {
      var body = JSON.parse(event.body);
      var talk = body.talk;
      var response = {
          statusCode: 200,
          headers: {'Content-Type': 'application/json'},
          body: JSON.stringify(talk)
      };
      callback(null, response);
  };
  </code></pre>
  
  <p>What it is happening? Why the test button work differently from a POST request? I want both to work, specially the test because I want to "debug" the "serverless"</p>