Created
September 16, 2021 03:10
-
-
Save kgravenreuth/e51b2178bae982ad7aea53a9840ea922 to your computer and use it in GitHub Desktop.
Cloudbet API Account Balances 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
req, err := http.NewRequest("GET", "https://sports-api.cloudbet.com/pub/v1/account/currencies", nil) | |
if err != nil { | |
return 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") | |
client := &http.Client{} | |
resp, err := client.Do(req) | |
if err != nil { | |
return err | |
} | |
bodyText, err := ioutil.ReadAll(resp.Body) | |
if err != nil { | |
return err | |
} | |
fmt.Printf("%s\n", bodyText) // {"currencies":["BONUS_EUR","BTC","ETH","PLAY_EUR"]} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment