Guest User

Untitled

a guest
Dec 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. // Read the content
  2. var bodyBytes []byte
  3. if c.Request.Body != nil {
  4. bodyBytes, _ = ioutil.ReadAll(c.Request.Body)
  5. }
  6.  
  7. // Restore the io.ReadCloser to its original state
  8. c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))
  9.  
  10. // Use the content
  11. bodyString := string(bodyBytes)
Add Comment
Please, Sign In to add comment