When using the AWS CLI you may receive the following exception:
An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Could not parse payload into json: Invalid UTF-8 middle byte 0x28
You will see this exception in numerous cases to include when running ‘aws lambda invoke’, etc. This is happening because you are running v2 of the AWS CLI.
You have two options to address:
- revert to using v1 of the CLI
- add ‘–cli-binary-format raw-in-base64-out’ to your command if sticking with v2