Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Read the content
- var bodyBytes []byte
- if c.Request.Body != nil {
- bodyBytes, _ = ioutil.ReadAll(c.Request.Body)
- }
- // Restore the io.ReadCloser to its original state
- c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))
- // Use the content
- bodyString := string(bodyBytes)
Add Comment
Please, Sign In to add comment