<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...

[ ] bug report
[x] feature request

# Detailed description

The API Gateway response body only accepts strings. To transfer binary data, it needs to be base64 encoded, inserted as a string in the response body and the flag ´isBase64Encoded´ must be set. Once this is done API Gateway will base64 decode the response and return the binary content to the requester.

## Expected behavior

When setting the isBase64Encoded flag, the response is base64 decoded before being returned from API Gateway.

## Actual behavior

Setting the isBase64Encoded flag has no effect, the response body will contain the base64 encoded string instead of binary data.

# Steps to reproduce

## Command used to start LocalStack

Docker compose config:
```
version: '2.1'

services:
  docker-host:
    image: qoomon/docker-host:2.5.0
    cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
    mem_limit: 20M
    restart: on-failure
  localstack:
    image: localstack/localstack:0.12.10
    depends_on: [ docker-host ]
    ports:
      - "4566:4566"
      - "4571:4571"
    environment:
      - DOCKER_HOST=unix:///var/run/docker.sock
      - HOST_TMP_FOLDER=${TMPDIR}
      - DATA_DIR=${TMPDIR}/data
      - DEFAULT_REGION=eu-west-1
      - LAMBDA_REMOTE_DOCKER=0
      - LAMBDA_EXECUTOR=docker-reuse
      - LAMBDA_DOCKER_NETWORK=scripts_default
      - AWS_CBOR_DISABLE=true
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

```

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)

Need to set up a Lambda Rest API that returns a base64 encoded string, where the flag `isBase64Encoded` is set. The returned response should reflect the base64 decoded version of the string.

if uri.startswith('arn:aws:apigateway:') and ':dynamodb:action' in uri:
            
            table_name = uri.split(':dynamodb:action')[1].split('&Table=')[1]
            action = uri.split(':dynamodb:action')[1].split('&Table=')[0]
            if 'PutItem' in action and method == 'PUT':
                response_template = response_templates.get('application/json')
                if response_template is None:
                    msg = 'Invalid response template defined in integration response.'
                    LOG.info('%s Existing: %s' % (msg, response_templates))
                    return make_error_response(msg, 404)
                response_template = json.loads(response_template)
                if response_template['TableName'] != table_name:
                    msg = 'Invalid table name specified in integration response template.'
                    return make_error_response(msg, 404)
                dynamo_client = aws_stack.connect_to_resource('dynamodb')
                table = dynamo_client.Table(table_name)
                event_data = {}
                data_dict = json.loads(data)
                for key, _ in response_template['Item'].items():
                    event_data[key] = data_dict[key]
                table.put_item(Item=event_data)
                response = requests_response(event_data, headers=aws_stack.mock_aws_request_headers())
                return response
        else:
            raise Exception('API Gateway action uri "%s", integration type %s not yet implemented' %
                (uri, integration_type))
    elif integration_type in ['HTTP_PROXY', 'HTTP']:
        if ':servicediscovery:' in uri:
            
            client = aws_stack.connect_to_service('servicediscovery')