# AWS Python Lambda Integration to Return JSON response directly

**URL:** <https://forum.serverless.com/t/aws-python-lambda-integration-to-return-json-response-directly/9911>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [November 19, 2019, 7:46am UTC](https://forum.serverless.com/t/aws-python-lambda-integration-to-return-json-response-directly/9911 "2019-11-19T07:46:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattsunsjf](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mattsunsjf](https://forum.serverless.com/u/mattsunsjf)\
**Post date:** [November 19, 2019, 7:46am UTC](https://forum.serverless.com/t/aws-python-lambda-integration-to-return-json-response-directly/9911/1 "2019-11-19T07:46:53Z")

</div>

Hi, I’m trying to find out how can I return the response as a JSON directly.  
This is a function on AWS with Lambda Proxy Integration. All default setting.  
The goal is to from the python lambda function, the HTTP response client gets is directly a JSON object, instead of a string serialization of a JSON.

The python handler is as simple as this one

```
def handle(event, context):
    log.info("Hello Wold")
    log.info(json.dumps(event, indent=2))
    return {
        "statusCode": 200,
        "body": {"foo": "bar"},
        "headers": {
            "Content-Type": "application/json"
        }
    }

```

The function looks like this:

```
functions:
  report:
    handler: handler.handle
    events:
      - http:
          path: api/mypath
          method: post
          authorizer: aws_iam

```

With these configurations, the response BODY I get in Postman is:

```
{
    "statusCode": 200,
    "body": {
        "foo": "bar"
    },
    "headers": {
        "Content-Type": "application/json"
    }
}

```

So this is strange, why I get everything as body? How do I configure it properly only the “real” body?
