title: Send a request with a body to AWS Lambda
body: <p>I have uploaded an AWS Lambda function where the lambda_handler looks as follows:</p>
  
  <pre><code>import json
  def lambda_handler(event, context):
  
      print(event)
  
      return {
          'statusCode': 200,
          'body': json.dumps('Hello from Lambda!'),
          'event': event
      }
  </code></pre>
  
  <p><strong>Problem 1: returning <code>event</code></strong> </p>
  
  <p>When I test it using the Lambda Management Console I can create a test event with parameters which also return the exact same format and all works fine:</p>
  
  <pre><code>{
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }
  </code></pre>
  
  <p>However, when I use Postman, then I get something totally else, which returns to me:</p>
  
  <pre><code>{
      "message": "Internal server error"
  }
  </code></pre>
  
  <p>I suspect its because the <code>event</code> looks something more like:</p>
  
  <pre><code>{'resource': '/hello', 'path': '/hello', 'httpMethod': 'GET', 'headers': {'Accept': '*/*', ... etc
  </code></pre>
  
  <p><strong>Problem 2: adding json parameters in body creates an error</strong></p>
  
  <p>When I try in Postman to add in the body > raw > JSON(application/JSON) the keys above, then I get the error:</p>
  
  <pre><code>ERROR: The request could not be satisfied
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <p>I have two questions:</p>
  
  <ul>
  <li>How do I pass parameters in the body and be able to capture it in AWS lambda using the event or context?</li>
  <li>How do I return the event properly?</li>
  </ul>