我正在尝试发送 HTTP Post 请求以将记录放入 Amazon Kinesis Stream。有多种方法(Kinesis 客户端、KPL、将 AWS 网关设置为 Kinesis 代理)。
我看到了关于 Kinesis PutRecord API http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html 的文档
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
Content-Length: <PayloadSizeBytes>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Authorization: <AuthParams>
Connection: Keep-Alive
X-Amz-Date: <Date>
X-Amz-Target: Kinesis_20131202.PutRecord
{
"StreamName": "exampleStreamName",
"Data": "XzxkYXRhPl8x",
"PartitionKey": "partitionKey"
}
Run Code Online (Sandbox Code Playgroud)
是否可以将上述 HTTP POST 请求发送到 PutRecord,而无需按照此链接中的说明设置 Amazon API 网关:http ://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer 。 html#call-api-with-api-gateway-custom-authorization
KPL 和 Kinesis Client 必须以某种方式在内部使用 HTTP POST 到 PutRecord,因此必须有一种方法可以这样做。不幸的是,我在网上找不到任何资源。