我正在尝试从这个简单的 Lambda 中访问键值
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"net/http"
)
func Draw(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
return events.APIGatewayProxyResponse{
StatusCode: http.StatusOK,
Body: "Draw API " + request.Body,
}, nil
}
func main() {
// https://www.alexedwards.net/blog/serverless-api-with-go-and-aws-lambda
lambda.Start(Draw)
}
并带有简单的卷曲
curl -d "timestamp=11223344" https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/api/draw
我得到
Draw API timestamp=11223344
我如何获得键/值字符串或带有参数名称和值的映射?不幸的是我不能使用 json 作为输入
谢谢!
千巷猫影
相关分类