aboutsummaryrefslogtreecommitdiff
path: root/anime/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'anime/util.go')
-rw-r--r--anime/util.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/anime/util.go b/anime/util.go
index f1f3b2a..862b54d 100644
--- a/anime/util.go
+++ b/anime/util.go
@@ -25,18 +25,16 @@ import (
// Handles HTTP request with your OAuth token as a Header
// TODO: Verify that this function is safe to use
-func requestHandler(token string, endpoint string) string {
- client := &http.Client{}
-
+func (c AnimeClient) requestHandler(endpoint string) string {
// generate request
req, err := http.NewRequest("GET", endpoint, nil)
if err != nil {
log.Fatal(err)
}
- req.Header.Add("Authorization", token)
+ req.Header.Add("Authorization", c.AuthToken)
// do request
- res, err := client.Do(req)
+ res, err := c.HttpClient.Do(req)
if err != nil {
log.Fatal(err)
}