Skip to content

Instantly share code, notes, and snippets.

@iCoolchar
Last active April 25, 2017 09:12
Show Gist options
  • Save iCoolchar/83b74afb02dc6010574c1ec2dfe2d7f9 to your computer and use it in GitHub Desktop.
Save iCoolchar/83b74afb02dc6010574c1ec2dfe2d7f9 to your computer and use it in GitHub Desktop.
read http request body
client := &http.Client{}
req, _ := http.NewRequest("GET", url, nil)
res, err := client.Do(req)
bodyBytes, _ := ioutil.ReadAll(res.Body)
fmt.Println("body is", string(bodyBytes))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment