Skip to content

Instantly share code, notes, and snippets.

@ry4nz
Created January 23, 2020 20:31
Show Gist options
  • Save ry4nz/1900ab11b186f77bdeefa50d712ab17b to your computer and use it in GitHub Desktop.
Save ry4nz/1900ab11b186f77bdeefa50d712ab17b to your computer and use it in GitHub Desktop.
// Generated by curl-to-Go: https://mholt.github.io/curl-to-go
// TODO: This is insecure; use only in dev environments.
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
req, err := http.NewRequest("GET", "https://api.pro.coinbase.com/products", nil)
if err != nil {
// handle err
}
resp, err := client.Do(req)
if err != nil {
// handle err
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var products []Product
json.Unmarshal(body, &products)
fmt.Println(products)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment