用于执行 API Gateway 的 AWS CLI 命令

sno*_*der 2 amazon-web-services aws-cli aws-api-gateway

我正在尝试在 EC2 实例中使用 AWS CLI 执行 API 网关。我在 AWS CLI 文档中没有找到任何命令。以前有人使用过 CLI 来执行 API 网关端点吗?

感谢

Sim*_*am5 8

现在,AWS CLI 版本 2 可以实现这一点。

https://docs.aws.amazon.com/cli/latest/reference/apigateway/test-invoke-method.html

以下是使用文件作为请求正文的测试 POST 示例:

aws --region us-west-2 apigateway test-invoke-method --rest-api-id abcd1234 --resource-id abcd12 --http-method POST --path-with-query-string '/records/create' --body file://test-body.json
Run Code Online (Sandbox Code Playgroud)