Skip to content

Example in apigatewaymanagementapi post-to-connection failed #6983

Description

@johnc-c

Describe the bug

Got the error when running the example in the awscli/examples/apigatewaymanagementapi/post-to-connection.rst
aws apigatewaymanagementapi post-to-connection --connection-id L0SM9cOFvHcCIhw= --data "Hello from API Gateway!" --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod

Invalid base64: "Hello from API Gateway!"

Expected Behavior

Could not connect to the endpoint URL:"https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod/@connections/L0SM9cOFvHcCIhw%3D"

Current Behavior

aws apigatewaymanagementapi post-to-connection --connection-id L0SM9cOFvHcCIhw= --data "Hello from API Gateway!" --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod

Invalid base64: "Hello from API Gateway!"

Reproduction Steps

Run the cmd

aws --version

aws-cli/2.1.18

aws apigatewaymanagementapi post-to-connection --connection-id L0SM9cOFvHcCIhw= --data "Hello from API Gateway!" --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod

Invalid base64: "Hello from API Gateway!"

Possible Solution

It worked after adding the "--cli-binary-format".

aws apigatewaymanagementapi post-to-connection --connection-id L0SM9cOFvHcCIhw= --cli-binary-format raw-in-base64-out --data "Hello from API Gateway!" --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod

Could not connect to the endpoint URL: "https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod/@connections/L0SM9cOFvHcCIhw%3D

Additional Information/Context

No response

CLI version used

aws-cli/2.1.18 Python/3.7.3

Environment details (OS name and version, etc.)

Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions