You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use resty for the get request, I cannot parse the request body message cause it's empty. The follow codes can repeat the issue. By the way, if I change the both side request method as post, it works.
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /get-request-test --> main.main.func1 (3 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on :8080
2023/02/21 17:09:51 parse body failed: EOF
[GIN] 2023/02/21 - 17:09:51 | 400 | 1.537488ms | 127.0.0.1 | GET "/get-request-test"
test log
=== RUN Test_GetRequest
resty_test.go:24: Request Failed, Status Code 400
--- FAIL: Test_GetRequest (0.01s)
FAIL
The text was updated successfully, but these errors were encountered:
When I use resty for the get request, I cannot parse the request body message cause it's empty. The follow codes can repeat the issue. By the way, if I change the both side request method as post, it works.
go.mod
main.go
resty_test.go
server log
test log
The text was updated successfully, but these errors were encountered: