java AWS API网关获取API密钥
我试图从API网关的“API密钥”中的API密钥获取实际密钥
AmazonApiGateway client = AmazonApiGatewayClientBuilder.standard().withRegion("my region").build();
GetApiKeysRequest req = new GetApiKeysRequest();
GetApiKeysResult keys = client.getApiKeys(req);
ApiKey key = keys.getItems().get(0); // just get the first one..
System.out.println(key.getId());
System.out.println(key.getName());
System.out.println(key.getValue());
希望getValue()能够提供实际的密钥,但它是空的
# 1 楼答案
确保将includeValues设置为
true
: