当我尝试调用 Lambda 函数(以下是我的代码)时,我在 CloudWatch Logs 中收到错误消息,指出输入不是有效的 Base-64 字符串。
String payload = "xxxxxxxxxxx";
SdkBytes payloadBytes = SdkBytes.fromUtf8String(payload);
String routingUri = getRoutingUri();
InvokeRequest invokeRequest = InvokeRequest.builder()
.functionName(routingUri)
.payload(payloadBytes)
.invocationType("RequestResponse")
.build();
InvokeResponse result = lambdaClient.invoke(invokeRequest);
Error : System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
我尝试了各种方法以 Base-64 对请求进行编码,但似乎没有任何效果
- 我的 AWS 开发工具包版本是 2.15.14
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.15.14</version>
</dependency>
请帮忙。