79242736

Date: 2024-12-02 00:54:10
Score: 1
Natty:
Report link

You can access the underlying http.Request object and read the raw POST data from there.

func handler(c *gin.Context) string {
    request := c.Request
    body, _ := io.ReadAll(request.Body)
    defer request.Body.Close()  //Need to close Body after reading it.

    return string(body)
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: KGolden