Created
September 16, 2021 03:11
-
-
Save kgravenreuth/e757a4506c242041ad71102cb5759da9 to your computer and use it in GitHub Desktop.
Cloudbet API Balance for your currency in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client := &http.Client{} | |
req, err := http.NewRequest("GET", "https://sports-api.cloudbet.com/pub/v1/account/currencies/PLAY_EUR/balance", nil) | |
if err != nil { | |
log.Fatal(err) | |
} | |
req.Header.Set("accept", "application/json") | |
req.Header.Set("X-API-Key", "eyJ...") // <-- use your API key | |
req.Header.Set("Content-Type", "application/json") | |
resp, err := client.Do(req) | |
if err != nil { | |
log.Fatal(err) | |
} | |
bodyText, err := ioutil.ReadAll(resp.Body) | |
if err != nil { | |
log.Fatal(err) | |
} | |
fmt.Printf("%s\n", bodyText) // {"amount":"984.69"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment