I have on Lambda function which input is
input_str = "<html><body><h1>Title</h1><Hello World></body></html>"
input_base64 = base64.b64encode(bytes(input_str, 'utf-8'))
payload = {"html_base64" : input_base64}
here input_base64 is bytes type variable
I am invoking this Lambda function from other Lambda function, but I am not able pass this payload
invoke_response = lambda_client.invoke(FunctionName="vivek_05",
InvocationType='RequestResponse',
Payload=payload
)
Getting following exception:
"errorMessage": "Parameter validation failed:\nInvalid type for parameter Payload, value: {'html_base64': b'PGh0bWw+PGJvZHk+PGgxPlRpdGxlPC9oMT48SGVsbG8gV29ybGQ+PC9ib2R5PjwvaHRtbD4='}, type: <class 'dict'>, valid types: <class 'bytes'>, <class 'bytearray'>, file-like object",
Can you help me?
Payload=json.dumps(payload).