从 AWS API 密钥获取使用状态
Get usage status from AWS API key
我有一个 AWS serverless API configured with a usage plan。我希望用户能够知道他们可以发出多少请求,这样他们就不会陷入困境:
HTTP/2 429
content-type: application/json
content-length: 28
date: Mon, 16 Apr 2018 03:41:12 GMT
x-amzn-requestid: 02436b06-4128-11e8-aa37-8f617035a300
x-amzn-errortype: LimitExceededException
x-cache: Error from cloudfront
via: 1.1 de2aa82ec56d0a6d749df4bf0a88b28f.cloudfront.net (CloudFront)
x-amz-cf-id: afyULHDbLwJYAJO07zLeFG1Q0tZA-VhB3kezRgE1UBldQdfaGRQaZQ==
{"message":"Limit Exceeded"}
我一直在查看 AWS 文档https://docs.aws.amazon.com/cli/latest/reference/apigateway/index.html#cli-aws-apigateway & https://docs.aws.amazon.com/sdk-for-go/api/service/apigateway/
而且我似乎无法弄清楚如何判断允许 API 密钥发出多少请求!我的目标是查看当前用户的类似 Twitter 的内容:
x-rate-limit-limit: 1500
x-rate-limit-remaining: 1499
x-rate-limit-reset: 1523850782
我错过了什么?
我有一个 AWS serverless API configured with a usage plan。我希望用户能够知道他们可以发出多少请求,这样他们就不会陷入困境:
HTTP/2 429
content-type: application/json
content-length: 28
date: Mon, 16 Apr 2018 03:41:12 GMT
x-amzn-requestid: 02436b06-4128-11e8-aa37-8f617035a300
x-amzn-errortype: LimitExceededException
x-cache: Error from cloudfront
via: 1.1 de2aa82ec56d0a6d749df4bf0a88b28f.cloudfront.net (CloudFront)
x-amz-cf-id: afyULHDbLwJYAJO07zLeFG1Q0tZA-VhB3kezRgE1UBldQdfaGRQaZQ==
{"message":"Limit Exceeded"}
我一直在查看 AWS 文档https://docs.aws.amazon.com/cli/latest/reference/apigateway/index.html#cli-aws-apigateway & https://docs.aws.amazon.com/sdk-for-go/api/service/apigateway/
而且我似乎无法弄清楚如何判断允许 API 密钥发出多少请求!我的目标是查看当前用户的类似 Twitter 的内容:
x-rate-limit-limit: 1500
x-rate-limit-remaining: 1499
x-rate-limit-reset: 1523850782
我错过了什么?