HTTPMethod is empty
Open
troubleshooting
- Dominant language
- Go
- Stars
- 3.8k
- Forks
- 578
- Avg merge
- 8h 18m
- Merged PRs (30d)
- 1
Description
Tried to use the `events.APIGatewayProxyRequest.HTTPMethod` but it returned `""`
Here's the full handler
```go
func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
fmt.Println("Received body: ", request.Body)
switch request.HTTPMethod {
case "POST":
return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil
default: // GET
response := events.APIGatewayProxyResponse{
Body: request.QueryStringParameters["value"],
StatusCode: 200,
}
return response, nil
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.