我有一个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
我错过了什么?